mirror of
https://github.com/discourse/discourse.git
synced 2025-02-08 04:18:23 +00:00
Have oneboxer default to page title when og:title is missing
This commit is contained in:
parent
921c3f016f
commit
85b0c0afab
@ -9,6 +9,11 @@ module Oneboxer
|
|||||||
result[prop] = (node['content'] || node['value']) if node
|
result[prop] = (node['content'] || node['value']) if node
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# If there's no title, try using the page's title
|
||||||
|
if result['title'].blank?
|
||||||
|
result['title'] = doc.title
|
||||||
|
end
|
||||||
|
|
||||||
# If there's no description, try and get one from the meta tags
|
# If there's no description, try and get one from the meta tags
|
||||||
if result['description'].blank?
|
if result['description'].blank?
|
||||||
node = doc.at("/html/head/meta[@name='description']")
|
node = doc.at("/html/head/meta[@name='description']")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user