{# ============================================================================= posts.html — Blog Listing Layout (Plural Template) ============================================================================= This template is resolved by Moosey's Waterfall for section index pages (e.g., /posts). It provides: • Section title and description from frontmatter • Main content area rendering posts/index.md body • Sidebar with sibling navigation (nav_items) — sorted by frontmatter Waterfall Resolution (for /posts): 1. Frontmatter override → (not set) 2. Exact match → (path is "posts", is_index=True, so skip) 3. Singular parent → templates/post.html (single item layout) 4. Plural parent → templates/posts.html (USED! section listing) 5. Fallback → templates/page.html Why posts.html exists: Without this file, /posts would render with post.html (singular), which is designed for individual articles. posts.html provides a listing/index layout optimised for showing multiple entries. Template Variables: {{ title }} – from posts/index.md frontmatter {{ description }} – from frontmatter {{ content }} – rendered Markdown from posts/index.md body {{ nav_items }} – sibling pages (individual blog posts, sorted) {{ breadcrumbs }} – breadcrumb trail {{ slug }} – URL slug ("posts") nav_items in this context: Each item represents a blog post (e.g., building-modern-apps.md): .name – post title from frontmatter .url – /posts/building-modern-apps .is_active – True if this is the current page .metadata – full frontmatter dict .tags – ["fastapi", "python", ...] .date – frontmatter date .image – featured image URL .description – post excerpt Extends: layout/base.html ============================================================================= #} {% extends "layout/base.html" %} {% block content %}
{# -- Section Header -- #} {# {{ title }} comes from content/posts/index.md frontmatter. If that file has no "title" in frontmatter, Moosey derives one from the URL segment ("Posts"). #}

{{ title }}

{{ description }}

{# ============================================================ MAIN CONTENT AREA ============================================================ This renders the body of content/posts/index.md. In this example, the Markdown file contains a brief intro text. The actual blog post listing is in the sidebar. You could also use get_files('./content/posts') here to render a grid of post cards directly. #}
{{ content | safe }}
{# ============================================================ SIDEBAR: Archive / Post List ============================================================ nav_items contains all sibling files in the /posts content directory (sorted by frontmatter "order", then by name). Each item.metadata contains the full frontmatter of the referenced Markdown file, enabling rich list entries: Example — showing metadata in a nav item:

{{ item.metadata.description }}

{{ item.name }} {{ item.metadata.tags[0] }} #}
{% endblock %}