mirror of
https://github.com/andwati/andwati.com.git
synced 2026-11-02 15:52:15 +00:00
fix zola.toml config table scoping bug and JSON-LD safety
[[extra.menu]] silently swallowed ~20 later extra.* keys (posts_page_title, search_placeholder, show_rss_link, notfound_*, etc.) into the last menu entry/tag_descriptions table, since TOML absorbs bare keys into the last open table until a new header appears. show_rss_link was the only visibly broken one (RSS link missing from homepage); the rest were masked by matching template defaults. Also replaced Tera's default() filter with explicit if/else where values feed into JSON-LD, since default()'s fallback gets escaped in a way `safe` can't undo. Added author/dateModified to BlogPosting list entries.
This commit is contained in:
@@ -30,9 +30,14 @@ og_description %}{{ config.extra.posts_page_subtitle | default(value="Exploring
|
||||
"@type": "BlogPosting",
|
||||
"@id": "{{ page.permalink | safe }}#article",
|
||||
"headline": {{ page.title | json_encode | safe }},
|
||||
"image": "{{ config.base_url | safe }}{{ page.extra.image | default(value="/images/og-image.png") | safe }}",
|
||||
"url": "{{ page.permalink | safe }}"
|
||||
"image": "{{ config.base_url | safe }}{% if page.extra.image %}{{ page.extra.image | safe }}{% else %}/images/og-image.png{% endif %}",
|
||||
"url": "{{ page.permalink | safe }}",
|
||||
"author": {
|
||||
"@type": "Person",
|
||||
"@id": "{{ config.base_url | safe }}/#author"
|
||||
}
|
||||
{% if page.date %},"datePublished": "{{ page.date | date(format="%+") }}"{% endif %}
|
||||
{% if page.updated %},"dateModified": "{{ page.updated | date(format="%+") }}"{% elif page.date %},"dateModified": "{{ page.date | date(format="%+") }}"{% endif %}
|
||||
}{% if not loop.last %},{% endif %}
|
||||
{% endfor %}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user