From b95a4fd78d45c601bf26b28cc28a7361960110f1 Mon Sep 17 00:00:00 2001 From: Stephan Date: Mon, 22 Mar 2021 20:58:05 +0100 Subject: [PATCH] List last 3 blog posts in menu. --- templates/header_slim.html | 12 ++++++++++++ templates/header_with_logo.html | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/templates/header_slim.html b/templates/header_slim.html index 28418d10..320859f6 100644 --- a/templates/header_slim.html +++ b/templates/header_slim.html @@ -57,6 +57,18 @@ {{ sub_title }} + {% if sub_title == 'Blog' %} + {% set children = site.get(href).children %} + {% for child in children %} + {% if loop.index <= 3 %} +
  • + + {{ child.title }} + +
  • + {% endif %} + {% endfor %} + {% endif %} {% endfor %} {% endif %} diff --git a/templates/header_with_logo.html b/templates/header_with_logo.html index 658ed19d..137f3ee9 100644 --- a/templates/header_with_logo.html +++ b/templates/header_with_logo.html @@ -57,6 +57,18 @@ {{ sub_title }} + {% if sub_title == 'Blog' %} + {% set children = site.get(href).children %} + {% for child in children %} + {% if loop.index <= 3 %} +
  • + + {{ child.title }} + +
  • + {% endif %} + {% endfor %} + {% endif %} {% endfor %} {% endif %}