Files
andwati.com/templates/index.html
T
andwati 3e1c643283 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.
2026-07-17 15:59:27 +03:00

51 lines
2.2 KiB
HTML

{% extends "base.html" %} {% block canonical %}{{ config.base_url }}/{% endblock canonical %} {%
block og_url %}{{ config.base_url }}/{% endblock og_url %} {% block head %}
<!-- SEO: Blog (Homepage) JSON-LD -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Blog",
"@id": "{{ config.base_url | safe }}/#blog",
"name": {{ config.title | json_encode | safe }},
"description": {{ config.description | json_encode | safe }},
"url": "{{ config.base_url | safe }}/",
"inLanguage": "en-US",
"author": {
"@type": "Person",
"@id": "{{ config.base_url | safe }}/#author"
},
"blogPost": [
{% set section = get_section(path="posts/_index.md") %}
{% for page in section.pages %}
{
"@type": "BlogPosting",
"@id": "{{ page.permalink | safe }}#article",
"headline": {{ page.title | json_encode | 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 %}
]
}
</script>
{% endblock head %} {% block content %} {% include "partials/profile.html" %}
{% set section = get_section(path="posts/_index.md") %}
<h2 class="feed-heading">{{ config.extra.homepage_feed_heading | default(value="Latest") }}</h2>
<div class="post-feed-list">
{% set post_limit = config.extra.homepage_post_limit | default(value=3) %}
{% for page in section.pages | slice(end=post_limit) %} {% include "partials/post-card.html" %} {% endfor %}
</div>
<div class="view-all-posts">
<a href="/posts" class="btn-view-all">{{ config.extra.view_all_posts_label | default(value="View all posts") }}</a>
</div>
{% endblock content %}