From b17ccbd2fa987395d42313a81b2227f5ec8d88ac Mon Sep 17 00:00:00 2001 From: Serghei Iakovlev Date: Sat, 28 May 2022 11:12:09 +0200 Subject: Rework the "Latest Publications" section --- layouts/partials/mini-toc.html | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 layouts/partials/mini-toc.html (limited to 'layouts/partials/mini-toc.html') diff --git a/layouts/partials/mini-toc.html b/layouts/partials/mini-toc.html new file mode 100644 index 0000000..4d4d742 --- /dev/null +++ b/layouts/partials/mini-toc.html @@ -0,0 +1,26 @@ +{{/* Define a section to pull recent posts from. + This will default to the section with the most number of pages. */}} +{{ $mainSections := site.Params.mainSections | default (slice "post") }} + +{{/* Create a variable with that section to use in multiple places. */}} +{{ $section := where site.RegularPages "Section" "in" $mainSections }} + +{{/* Check to see if the section is defined for ranging through it */}} +{{ $sectionCount := len $section }} + +{{ if ge $sectionCount 1 }} + {{ $mxPosts := site.Params.recentPostsSize | default 5 }} + + +{{ end }} -- cgit v1.2.3