mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
First stab at oneboxing of meta.discourse.org
This commit is contained in:
@@ -36,7 +36,7 @@ module ApplicationHelper
|
||||
def crawlable_meta_data(opts=nil)
|
||||
|
||||
opts ||= {}
|
||||
opts[:image] ||= "#{Discourse.base_url}#{SiteSetting.logo_url}"
|
||||
opts[:image] ||= "#{Discourse.base_url}#{SiteSetting.logo_small_url}"
|
||||
opts[:url] ||= "#{Discourse.base_url}#{request.fullpath}"
|
||||
|
||||
# Add opengraph tags
|
||||
@@ -45,8 +45,8 @@ module ApplicationHelper
|
||||
result << tag(:meta, property: 'twitter:card', content: "summary")
|
||||
[:image, :url, :title, :description].each do |property|
|
||||
if opts[property].present?
|
||||
result << tag(:meta, property: "og:#{property}", content: opts[property]) << "\n"
|
||||
result << tag(:meta, property: "twitter:#{property}", content: opts[property]) << "\n"
|
||||
result << tag(:meta, {property: "og:#{property}", content: opts[property]}, nil, false) << "\n"
|
||||
result << tag(:meta, {property: "twitter:#{property}", content: opts[property]}, nil, false) << "\n"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user