From 555128c88b98cabe285ae6a773bd7c55815c8975 Mon Sep 17 00:00:00 2001 From: Emil Miler Date: Sat, 4 Dec 2021 21:34:47 +0100 Subject: [PATCH] Add page with all posts --- content/posts/_index.md | 2 ++ templates/macros.html | 4 ++-- templates/posts.html | 10 ++++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 templates/posts.html diff --git a/content/posts/_index.md b/content/posts/_index.md index ac36e06..eb13233 100644 --- a/content/posts/_index.md +++ b/content/posts/_index.md @@ -1,2 +1,4 @@ +++ +title = "All posts" +template = "posts.html" +++ diff --git a/templates/macros.html b/templates/macros.html index b66b46e..98a524a 100644 --- a/templates/macros.html +++ b/templates/macros.html @@ -1,5 +1,5 @@ -{% macro list_posts(section, count=0, taxonomy=false) %} - {% if taxonomy == false %} +{% macro list_posts(section=false, count=0, taxonomy=false) %} + {% if taxonomy == false and section != false %} {% set section = get_section(path=section~"/_index.md") %} {% endif %} {% for page in section.pages %} diff --git a/templates/posts.html b/templates/posts.html new file mode 100644 index 0000000..3db7726 --- /dev/null +++ b/templates/posts.html @@ -0,0 +1,10 @@ +{% extends "index.html" %} + +{% block title %} + {{ section.title }} — {{ config.title }} +{% endblock %} + +{% block content %} +

{{ section.title }}

+ {{ macros::list_posts() }} +{% endblock content %}