FEATURE: add custom open graph tag for ignoring canonical url

This commit is contained in:
Arpit Jalan 2017-08-15 19:23:03 +05:30
parent 506572bf04
commit b354099252
2 changed files with 5 additions and 1 deletions

View File

@ -212,6 +212,10 @@ module ApplicationHelper
result << tag(:meta, name: 'twitter:data2', value: "#{opts[:like_count]}")
end
if opts[:ignore_canonical]
result << tag(:meta, property: 'og:ignore_canonical', content: true)
end
result.join("\n")
end

View File

@ -88,7 +88,7 @@
<% content_for :head do %>
<%= auto_discovery_link_tag(@topic_view, {action: :feed, slug: @topic_view.topic.slug, topic_id: @topic_view.topic.id}, title: t('rss_posts_in_topic', topic: @topic_view.title), type: 'application/rss+xml') %>
<%= raw crawlable_meta_data(title: @topic_view.title, description: @topic_view.summary, image: @topic_view.image_url, read_time: @topic_view.read_time, like_count: @topic_view.like_count) %>
<%= raw crawlable_meta_data(title: @topic_view.title, description: @topic_view.summary, image: @topic_view.image_url, read_time: @topic_view.read_time, like_count: @topic_view.like_count, ignore_canonical: true) %>
<% if @topic_view.prev_page || @topic_view.next_page %>
<% if @topic_view.prev_page %>