Add linked data
This commit is contained in:
@@ -41,6 +41,9 @@ html x-data="{darkMode: $persist(false)}" :class="{'dark' : darkMode === true}"
|
|||||||
script type="speculationrules"
|
script type="speculationrules"
|
||||||
== context.speculation_rules
|
== context.speculation_rules
|
||||||
|
|
||||||
|
script type="application/ld+json"
|
||||||
|
== context.content_for(:linked_data)
|
||||||
|
|
||||||
meta property="og:title" content="#{context.content_for(:title)}"
|
meta property="og:title" content="#{context.content_for(:title)}"
|
||||||
meta property="og:type" content="website"
|
meta property="og:type" content="website"
|
||||||
meta property="og:url" content="#{context.content_for(:url)}"
|
meta property="og:url" content="#{context.content_for(:url)}"
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
- context.content_for(:title, "#{post.display_title} | ")
|
- context.content_for(:title, "#{post.display_title} | ")
|
||||||
- context.content_for(:url, post.permalink)
|
- context.content_for(:url, post.permalink)
|
||||||
- context.content_for(:image, post.key_image)
|
- context.content_for(:image, post.key_image)
|
||||||
|
- context.content_for(:linked_data, linked_data)
|
||||||
|
|
||||||
article class="h-entry"
|
article class="h-entry"
|
||||||
template @img-modal.window="imgModal = true; imgModalSrc = $event.detail.imgModalSrc; imgModalDesc = $event.detail.imgModalDesc;" x-if="imgModal"
|
template @img-modal.window="imgModal = true; imgModalSrc = $event.detail.imgModalSrc; imgModalDesc = $event.detail.imgModalDesc;" x-if="imgModal"
|
||||||
|
@@ -54,6 +54,26 @@ module Main
|
|||||||
expose :likes do |post|
|
expose :likes do |post|
|
||||||
post.webmentions.select { |w| w[:type] == "like" }
|
post.webmentions.select { |w| w[:type] == "like" }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
expose :linked_data do |post|
|
||||||
|
{
|
||||||
|
"@context": "https://schema.org",
|
||||||
|
"@type": "BlogPosting",
|
||||||
|
headline: post.name,
|
||||||
|
url: post.permalink,
|
||||||
|
author: {
|
||||||
|
"@type": "Person",
|
||||||
|
name: "Daniel Nitsikopoulos",
|
||||||
|
email: "hello@dnitza.com",
|
||||||
|
url: "https://dnitza.com"
|
||||||
|
},
|
||||||
|
mainEntityOfPage: post.permalink,
|
||||||
|
image: post.key_image,
|
||||||
|
datePublished: post.published_at,
|
||||||
|
dateCreated: post.published_at,
|
||||||
|
dateModified: post.published_at
|
||||||
|
}.to_json
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user