Add article:published_time meta tag to diary entries

This commit is contained in:
Anton Khorev 2024-08-14 17:59:00 +03:00
parent 735a5cf9e2
commit 09721c6fee
3 changed files with 15 additions and 1 deletions

View file

@ -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

View file

@ -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|