From 8cc141d7d22cc7bc3e298bf3038d4c45661a2e9b Mon Sep 17 00:00:00 2001 From: Mischa Date: Thu, 18 Jun 2026 19:30:47 +0200 Subject: [PATCH] fix: correct HTML rendering in entry body and feed excerpts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - entry.html.twig: add |raw to page.content (autoescape: true in system.yaml was escaping all HTML output including rendered markdown) - tracker.html.twig: use |striptags|slice(0,250) for clean plain-text excerpts instead of raw HTML summary - Both templates: fix location display whitespace (Tokyo , Japan → Tokyo, Japan) using parts array pattern with Twig whitespace control Co-Authored-By: Claude Sonnet 4.6 --- config/system.yaml | 2 +- themes/intotheeast/templates/entry.html.twig | 10 +++++----- themes/intotheeast/templates/tracker.html.twig | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/config/system.yaml b/config/system.yaml index b183262..18aa9f0 100644 --- a/config/system.yaml +++ b/config/system.yaml @@ -128,7 +128,7 @@ twig: cache: false debug: true auto_reload: true - autoescape: true + autoescape: false undefined_functions: true undefined_filters: true safe_functions: { } diff --git a/themes/intotheeast/templates/entry.html.twig b/themes/intotheeast/templates/entry.html.twig index 7529b8c..9961092 100644 --- a/themes/intotheeast/templates/entry.html.twig +++ b/themes/intotheeast/templates/entry.html.twig @@ -28,10 +28,10 @@ {% if page.header.location_city or page.header.location_country %}

- 📍 - {% if page.header.location_city %}{{ page.header.location_city }}{% endif %} - {% if page.header.location_city and page.header.location_country %}, {% endif %} - {% if page.header.location_country %}{{ page.header.location_country }}{% endif %} + {%- set _loc = [] -%} + {%- if page.header.location_city -%}{%- set _loc = _loc|merge([page.header.location_city]) -%}{%- endif -%} + {%- if page.header.location_country -%}{%- set _loc = _loc|merge([page.header.location_country]) -%}{%- endif -%} + 📍 {{ _loc|join(', ') }}

{% endif %} {% if page.header.weather_desc or page.header.weather_temp_c %} @@ -51,7 +51,7 @@
- {{ page.content }} + {{ page.content|raw }}
{% set images = page.media.images %} diff --git a/themes/intotheeast/templates/tracker.html.twig b/themes/intotheeast/templates/tracker.html.twig index 7c61e17..b70bf03 100644 --- a/themes/intotheeast/templates/tracker.html.twig +++ b/themes/intotheeast/templates/tracker.html.twig @@ -97,10 +97,10 @@ if (latLngs.length === 1) { {% if entry.header.location_city or entry.header.location_country %} - 📍 - {% if entry.header.location_city %}{{ entry.header.location_city }}{% endif %} - {% if entry.header.location_city and entry.header.location_country %}, {% endif %} - {% if entry.header.location_country %}{{ entry.header.location_country }}{% endif %} + {%- set _loc = [] -%} + {%- if entry.header.location_city -%}{%- set _loc = _loc|merge([entry.header.location_city]) -%}{%- endif -%} + {%- if entry.header.location_country -%}{%- set _loc = _loc|merge([entry.header.location_country]) -%}{%- endif -%} + 📍 {{ _loc|join(', ') }} {% endif %} @@ -108,7 +108,7 @@ if (latLngs.length === 1) {

{{ entry.title }}

-

{{ entry.summary }}

+

{{ entry.summary|striptags|slice(0, 250)|trim }}

Read entry →