{{ p.title }}
{% if p.description %}{{ p.description | truncate(180) }}
{% end %} {% if p.tags | length > 0 %} {% end %}{% extends "base.html" %}
{#
================================================================================
Blog List Template (Kida-Native)
================================================================================
Blog section index with featured posts, excerpts, and pagination.
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 breadcrumbs, pagination %}
{% from 'partials/components/tags.html' import tag_list %}
{# =============================================================================
POST CARD COMPONENTS
============================================================================= #}
{# Featured post card (larger, more prominent) - uses PostView for normalized access #}
{% def featured_card(post) %}
{% let p = post | post_view %}
{{ p.description | truncate(180) }} {{ p.description | truncate(200) }} {{ sub_desc }}
{{ p.title }}
{% if p.description %}
{{ p.title }}
{% if p.description %}
{{ sub_title }}
{% if sub_desc %}
{{ section_desc }}
{% end %} {% if total_pages > 0 %}Showing {{ posts | length }} of {{ total_posts }} posts {% if current_page > 1 %}(Page {{ current_page }} of {{ total_pages }}){% end %}
{% end %}No blog posts yet. Check back soon!