From a51faa7208957829231441cfed4be62628120615 Mon Sep 17 00:00:00 2001 From: code Date: Tue, 14 Jul 2026 18:01:30 +0000 Subject: [PATCH] Fix tags/changefreq/priority leaking into rendered page output A Twig {% block %} always emits its content wherever it's declared - wrapping novaconium/pages/_layout/layout.twig's metadata-only blocks (tags/changefreq/priority) in a plain {# #} comment doesn't suppress that, and a literal {% block %} tag inside a {# #} comment doesn't even compile (comments are stripped before parsing). Both bugs were present: the first caused "monthly 0.5" to appear as visible text in on every page; fixing that by wrapping the blocks in a real HTML comment tripped the second, a Twig SyntaxError, because the explanatory comment above them contained literal {% %}/{# #} sequences that terminated the outer Twig comment early. Fixed by wrapping the three blocks in an actual HTML comment (invisible to a reader/browser, still genuine Twig blocks - overridable and harvestable via renderBlock() exactly as before) and rewriting the explanatory comment without embedding literal Twig delimiter syntax. Verified the fix doesn't regress ContentIndexer's metadata extraction. --- novaconium/pages/_layout/layout.twig | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/novaconium/pages/_layout/layout.twig b/novaconium/pages/_layout/layout.twig index a726312..47a85d4 100644 --- a/novaconium/pages/_layout/layout.twig +++ b/novaconium/pages/_layout/layout.twig @@ -11,14 +11,23 @@ - {# tags/changefreq/priority are never output as HTML — declared here - only so they're overridable per-page (same mechanism as every SEO - block above) and harvestable by ContentIndexer via Twig's - renderBlock() API, not rendered into the page itself. See - /admin/docs/content-index. #} + {# tags/changefreq/priority (below) are metadata-only, not meant to be + visible on the page. A block tag always emits its content wherever + it's declared, though — and a Twig comment tag can't wrap a block + tag (Twig comments are stripped before parsing, so a nested block + tag inside one would never compile; don't put literal Twig + delimiter syntax inside a Twig comment's text either, for the same + reason — it terminates the comment early). So these three are + wrapped in a real HTML comment instead: invisible to a + reader/browser, but still genuine Twig blocks, overridable per-page + and harvestable by ContentIndexer via Twig's renderBlock() API + exactly like every SEO block above. See /admin/docs/content-index. #} + + {# Open Graph / Facebook #}