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/base.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'templates/base.html') diff --git a/templates/base.html b/templates/base.html index 051abf7..ddcaa60 100644 --- a/templates/base.html +++ b/templates/base.html @@ -43,7 +43,7 @@ }, { "@type": "WebSite", "@id": "{{ '/' | url(absolute=True, external=True) }}#website", - "name": "{{ bag('blog.name') }}", + "name": {{ bag('blog.name') | tojson }}, "url": "{{ '/' | url(absolute=True, external=True) }}", "author": { "@id": "{{ '/about' | url(absolute=True, external=True) }}#person" -- cgit v1.3.1