+1
-1
app/assets/stylesheets/application.css
+1
-1
app/assets/stylesheets/application.css
+2
-1
app/javascript/application.js
+2
-1
app/javascript/application.js
+14
app/javascript/custom/alt.js
+14
app/javascript/custom/alt.js
···
1
+
const allImgs = document.querySelectorAll("img[alt]");
2
+
3
+
function altButton() {
4
+
allImgs.forEach((im) => {
5
+
const det = document.createElement("details");
6
+
const sum = document.createElement("summary");
7
+
sum.textContent = "alt text";
8
+
det.appendChild(sum);
9
+
det.textContent = im.getAttribute("alt");
10
+
im.insertAdjacentElement("afterend", det);
11
+
})
12
+
}
13
+
14
+
altButton();
+3
-3
app/views/layouts/application.html.erb
+3
-3
app/views/layouts/application.html.erb
···
3
3
<head>
4
4
<title>
5
5
<% if defined?(@article.title) %>
6
-
<%= @article.title %>
6
+
<%= @article.title %> :: bubblegum
7
7
<% else %>
8
8
<% if defined?(@tag.name) %>
9
-
<%= @tag.name %>
9
+
<%= @tag.name %> :: bubblegum
10
10
<% else %>
11
11
sweet like bubblegum
12
12
<% end %>
···
19
19
<meta name="author" content="girl on the moon">
20
20
21
21
<meta property="og:title" content="<% if defined?(@article.title) %> <%= @article.title %> <% end %>">
22
-
<meta property="og:description" content="<% if defined?(@article.body) %> <%= truncate(@article.body, length: 27, separator: /\s/) %> <% end %>">
22
+
<meta property="og:description" content="<% if defined?(@article.body) %> <%= truncate(strip_tags(markdown(@article.body)), length: 27, separator: /\s/) %> <% end %>">
23
23
<meta property="og:image" content="<% if defined?(@article.slug) && !(@article.slug).nil? %> <%= article_url(@article.slug, format: :png) %> <% end %>">
24
24
<meta property="og:type" content="website">
25
25
<meta property="og:url" content="<% if defined?(@article.slug) && !(@article.slug).nil? %> <%= article_url(@article.slug) %> <% end %>">