mirror of
https://github.com/discourse/discourse.git
synced 2025-01-31 13:31:03 +08:00
add Twitter label meta tags only if value is present
This commit is contained in:
parent
bfd21461df
commit
2a819546ae
|
@ -146,12 +146,12 @@ module ApplicationHelper
|
|||
end
|
||||
end
|
||||
|
||||
if opts[:read_time]
|
||||
if opts[:read_time] && opts[:read_time] > 0
|
||||
result << tag(:meta, name: 'twitter:label1', value: I18n.t("reading_time"))
|
||||
result << tag(:meta, name: 'twitter:data1', value: "#{opts[:read_time]} mins 🕑")
|
||||
end
|
||||
|
||||
if opts[:like_count]
|
||||
if opts[:like_count] && opts[:like_count] > 0
|
||||
result << tag(:meta, name: 'twitter:label2', value: I18n.t("likes"))
|
||||
result << tag(:meta, name: 'twitter:data2', value: "#{opts[:like_count]} ❤")
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user