From e04012f4dae9bf0ad524c5869cf82f92d307cbae Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Wed, 4 Nov 2026 18:45:14 +0100 Subject: Ensure proper JSON encoding in structured data This applies Jinja's `tojson` filter to dynamically generated text fields in the site's JSON-LD templates, including titles, descriptions, keywords, and categories. This ensures special characters are escaped correctly and prevents invalid JSON in the generated structured data. --- templates/includes/blog-json-ld.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'templates/includes/blog-json-ld.html') diff --git a/templates/includes/blog-json-ld.html b/templates/includes/blog-json-ld.html index 63d3c66..4131913 100644 --- a/templates/includes/blog-json-ld.html +++ b/templates/includes/blog-json-ld.html @@ -3,8 +3,8 @@ "@context": "https://schema.org", "@type": "Blog", "@id": "{{ '/blog' | url(absolute=True, external=True) }}#blog", - "name": "{{ bag('blog.name') }}", - "description": "{{ bag('blog.tagline') }}", + "name": {{ bag('blog.name') | tojson }}, + "description": {{ bag('blog.tagline') | tojson }}, "url": "{{ '/blog' | url(absolute=True, external=True) }}", "inLanguage": "en", "isPartOf": { -- cgit v1.3.1