summaryrefslogtreecommitdiff
path: root/templates/base.html
diff options
context:
space:
mode:
authorDennis Fink2026-11-04 18:45:14 +0100
committerDennis Fink2026-11-04 18:45:14 +0100
commite04012f4dae9bf0ad524c5869cf82f92d307cbae (patch)
tree18509bb37912921e9dcf31c48dca8212d0e19566 /templates/base.html
parente7e365c239f766a8d2271c233f16c4df53a9bbb3 (diff)
downloaddennisfink.me-e04012f4dae9bf0ad524c5869cf82f92d307cbae.tar.gz
dennisfink.me-e04012f4dae9bf0ad524c5869cf82f92d307cbae.zip
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.
Diffstat (limited to 'templates/base.html')
-rw-r--r--templates/base.html2
1 files changed, 1 insertions, 1 deletions
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"