From 5c65f40bbca27dfb26e75cb027f287b2aa78cd3a Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Tue, 14 Jul 2026 19:38:31 +0200 Subject: Add structured data and microformats This adds JSON-LD for the site, author, blog, and individual blog posts, so search engines and other consumers can understand the blog structure more clearly. It also adds Microformats2 classes to blog posts and the about page, keeping machine-readable author, post, category, date, and content data attached to the visible HTML. --- templates/blog-post.html | 53 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) (limited to 'templates/blog-post.html') diff --git a/templates/blog-post.html b/templates/blog-post.html index 0844351..f5e8bbe 100644 --- a/templates/blog-post.html +++ b/templates/blog-post.html @@ -22,10 +22,63 @@ {% endfor %} {% endblock %} + +{% block json_ld %} + {{ super() }} + {% include "includes/blog-json-ld.html" %} + {% if this.publication_date %} + {% set post_url = this | url(absolute=True, external=True) %} + {% set post_id = post_url ~ '#blogposting' %} + {% set person_url = '/about' | url(absolute=True, external=True) %} + {% set person_id = person_url ~ '#person' %} + {% set blog_url = '/blog' | url(absolute=True, external=True) %} + {% set blog_id = blog_url ~ '#blog' %} + {% set modified_date = this.publication_date %} + {% if this.updated_date %} + {% set modified_date = this.updated_date %} + {% endif %} + {% set post_description = bag('blog.tagline') %} + {% if this.description %} + {% set post_description = this.description %} + {% endif %} + {% if this.category %} + {% set category = site.get("/categories/" + this.category).name %} + {% endif %} + + + {% endif %} +{% endblock %} + {% block styles %} {{ super() }} {% endblock %} + {% block content %}{{ render_blog_post(this) }}{% endblock %} -- cgit v1.3.1