Skip to content

Commit 93ab320

Browse files
committed
Add canonical urls to topics
1 parent a97a4cc commit 93ab320

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

app/views/topics/index.html.erb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
<% topics = @topics %>
22

3+
<% set_meta_tags(
4+
title: "Joy of Rails Topics",
5+
description: "Find articles categorized by topic on Joy of Rails",
6+
keywords: topics.pluck(:slug),
7+
canonical: topics_url
8+
) %>
9+
310
<%= render Pages::Header.new(title: "Topics") %>
411

512
<div class="column-content container py-gap mb-3xl">

app/views/topics/show.html.erb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
<% topic = @topic
22
topics = @topics %>
33

4+
<% set_meta_tags(
5+
title: "Joy of Rails Topics",
6+
description: "Find articles categorized as #{topic.name.inspect} on Joy of Rails",
7+
keywords: topic.slug,
8+
canonical: topic_url(topic)
9+
) %>
10+
411
<%= render Pages::Header.new(title: "Topics on Joy of Rails") %>
512

613
<div class="column-content container py-gap mb-3xl">

0 commit comments

Comments
 (0)