{{ sub_title }}
{% if sub_desc %}{{ sub_desc }}
{% end %} {% if page_count > 0 %} {% end %}{% extends "blog/shell.html" %}
{#
================================================================================
Blog List Template (Kida-Native)
================================================================================
Blog section index with featured posts, excerpts, and pagination. Extends blog/shell.html.
KIDA FEATURES USED:
- {% let %} for template-scoped variables
- Optional chaining (?.) for null-safe access
- Null coalescing (??) for smart defaults
- Pipeline operator (|>) for filter chains
- {% def %} for reusable post card components
- {% match %} for conditional rendering
CONTEXT VARIABLES:
- section: Section object with blog posts
- posts: List of blog post pages (may be paginated)
- subsections: Blog categories/archives
- total_pages: Total pagination pages
- current_page: Current page number
NOTE:
Uses post.word_count and post.reading_time computed properties
instead of filters for better performance (cached on first access).
USAGE:
Set `type: blog` in section _index.md
================================================================================
#}
{% from 'partials/navigation-components.html' import pagination %}
{% from 'partials/components/tags.html' import tag_list %}
{% from 'partials/components/post-card.html' import post_card %}
{# Category/subsection card #}
{% def category_card(subsection) %}
{% let sub_title = subsection?.title ?? 'Category' %}
{% let sub_href = subsection?.href ?? subsection?._path ?? '#' %}
{% let sub_desc = subsection?.metadata?.description ?? '' %}
{% let sub_pages = subsection?.regular_pages ?? [] %}
{% let index_page = subsection?.index_page %}
{% let index_path = index_page?._path ?? '' %}
{# Count non-index pages #}
{% let content_pages = sub_pages |> rejectattr('relative_url', 'eq', index_path) |> list %}
{% let page_count = content_pages | length %}
{{ sub_desc }} {{ section_desc }}
Showing {{ posts | length }} of {{ total_posts }} posts
{% if current_page > 1 %}(Page {{ current_page }} of {{ total_pages }}){% end %}
{{ sub_title }}
{% if sub_desc %}
{{ section_title }}
{% if section_desc %}
Featured Posts
Recent Posts
{% end %}
Categories
No blog posts yet. Check back soon!