Skip to content

Commit 15efca0

Browse files
committed
Add more meta-tags for articles
1 parent 91beb33 commit 15efca0

File tree

5 files changed

+19
-2
lines changed

5 files changed

+19
-2
lines changed
106 KB
Loading
62.9 KB
Loading

app/content/layouts/article.html.erb

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
1-
<%= set_meta_tags(
1+
<% set_meta_tags(
22
title: current_page.data.title!,
33
description: current_page.data.description,
4-
keywords: "Rails, Hotwire"
4+
keywords: %w[rails hotwire],
5+
index: true,
6+
icon: "/favicon.ico",
7+
og: {
8+
title: :title,
9+
description: :description,
10+
type: "article",
11+
url: current_page.url,
12+
site_name: "Joy of Rails",
13+
locale: "en_US",
14+
image: current_page.data.meta_image && asset_url(current_page.data.meta_image)
15+
},
16+
twitter: {
17+
card: current_page.data.meta_image ? "summary_large_image" : "summary",
18+
site: "@joyofrails",
19+
}
520
) %>
621
<%= render "application/skip_to_content" %>
722
<%= render_layout "application" do %>

app/content/pages/articles/custom-color-schemes-with-ruby-on-rails.html.mdrb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ description: You can edit the color scheme of this website right in content of t
66
summary: You can edit the color scheme of this website right in content of this blog post. Play with the controls while we highlight the benefits of Rails, Hotwire, and CSS variables.
77
published: 2024-07-15
88
image: articles/custom-color-schemes-with-ruby-on-rails/rainbows.jpg
9+
meta_image: articles/custom-color-schemes-with-ruby-on-rails/screenshot.jpg
910
uuid: d99f045b-f3f7-4408-811e-9701b1a13ce8
1011
tags:
1112
- Rails

app/content/pages/articles/introducing-joy-of-rails.html.mdrb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ published: '2024-05-02'
88
toc: false
99
uuid: 4106248b-ae8f-40a3-9853-48b91d815a71
1010
image: articles/introducing-joy-of-rails/adventure-world.gif
11+
meta_image: articles/introducing-joy-of-rails/screenshot.jpg
1112
tags:
1213
- Rails
1314
---

0 commit comments

Comments
 (0)