Skip to content

Commit

Permalink
Added ld+json
Browse files Browse the repository at this point in the history
  • Loading branch information
kura committed Aug 21, 2024
1 parent f721d3f commit adcc351
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .envrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pyversion=3.11.4 pyenv=kura.gg
pyversion=3.12.4 pyenv=kura.gg

use python ${pyversion}
layout virtualenv ${pyversion} ${pyenv}
Expand Down
3 changes: 3 additions & 0 deletions eevee/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@
{% include 'partials/feeds.html' %}
{% include 'partials/facebook.html' %}
{% include 'partials/twitter.html' %}
{% if article %}
{% include 'partials/ld_json.html' %}
{% endif %}
<link rel="icon" href="/favicon.png" type="image/png"
sizes="16x16 32x32 48x48 64x64 128x128 256x256" />
<link rel="icon" href="/favicon.ico" type="image/vnd.microsoft.icon"
Expand Down
26 changes: 26 additions & 0 deletions eevee/templates/partials/ld_json.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "BlogPosting",
"headline": "{{ article.title|striptags|escape|replace('※', '') }}",
"url": "{{ SITEURL }}/{{ article.url }}",
"description": "{{ article.summary|striptags|escape|replace('※', '') }}",
"author": {
"@type": "Person",
"name": "{{ article.author|title }}",
"url": "{{ SITEURL }}/{{ article.author.url }}"
},
"publisher": {
"@type": "Organization",
"name": "{{ SITENAME }}",
"url": "{{ SITEURL }}",
"logo": {
"@type": "ImageObject",
"url": "{{ SITEURL }}/favicon.png"
}
},
"mainEntityOfPage": "{{ SITEURL }}/{{ article.url }}",
"image": "{{ SITEURL }}/{{ article.url }}index.png",
"datePublished": "{{ article.date.isoformat() }}"
}
</script>

0 comments on commit adcc351

Please sign in to comment.