Add article:published_time meta tag to diary entries
This commit is contained in:
parent
735a5cf9e2
commit
09721c6fee
3 changed files with 15 additions and 1 deletions
|
@ -71,7 +71,8 @@ class DiaryEntriesController < ApplicationController
|
|||
@opengraph_properties = {
|
||||
"og:image" => @entry.body.image,
|
||||
"og:image:alt" => @entry.body.image_alt,
|
||||
"og:description" => @entry.body.description
|
||||
"og:description" => @entry.body.description,
|
||||
"article:published_time" => @entry.created_at.xmlschema
|
||||
}
|
||||
@comments = can?(:unhide, DiaryComment) ? @entry.comments : @entry.visible_comments
|
||||
else
|
||||
|
|
|
@ -10,6 +10,8 @@ module OpenGraphHelper
|
|||
"og:description" => properties["og:description"] || t("layouts.intro_text")
|
||||
}.merge(
|
||||
opengraph_image_properties(properties)
|
||||
).merge(
|
||||
properties.slice("article:published_time")
|
||||
)
|
||||
|
||||
safe_join(tags.map do |property, content|
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue