From 3ad84196b30907c7a0ce7ae726c07df96e5b3cd4 Mon Sep 17 00:00:00 2001
From: Patrick Kollitsch <davidsneighbourdev+gh@gmail.com>
Date: Wed, 15 Apr 2026 04:25:36 +0000
Subject: [PATCH] feat: add page-index shortcode
---
layouts/_shortcodes/page-index.html | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/layouts/_shortcodes/page-index.html b/layouts/_shortcodes/page-index.html
new file mode 100644
index 0000000..b96558c
--- /dev/null
+++ b/layouts/_shortcodes/page-index.html
@@ -0,0 +1,19 @@
+{{ $pagesBySection := site.RegularPages.GroupBy "Section" }}
+{{ $sortedSections := slice }}
+
+{{ range $pagesBySection }}
+ {{ $sectionPage := page.GetPage .Key }}
+ {{ $sortedSections = $sortedSections | append (dict "sectionPage" $sectionPage "pages" .Pages) }}
+{{ end }}
+
+{{ range sort $sortedSections "sectionPage.Weight" }}
+ <h3>{{ .sectionPage.Title }}</h3>
+
+ <ul>
+ {{ range .pages }}
+ <li>
+ <a href="{{ .Permalink }}">{{ .Title }}</a>
+ </li>
+ {{ end }}
+ </ul>
+{{ end }}
--
Gitblit v1.10.0