From 2cbd791c7a90b1e88718c4caab155c1ffe29619d Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Thu, 5 Nov 2026 10:09:22 +0100 Subject: feat: add layouts for the HardenedPass docs section Sidebar with the page tree and table of contents, collapsing into native details elements on mobile, and prev/next links that follow one reading order across subsections. The section joins the search index. Co-Authored-By: Claude Opus 5.5 --- layouts/hardenedpass/list.html | 22 ++++++++++++++++++++++ layouts/hardenedpass/single.html | 15 +++++++++++++++ layouts/index.json | 3 ++- layouts/partials/docs-nav.html | 25 +++++++++++++++++++++++++ layouts/partials/docs-pager.html | 10 ++++++++++ layouts/partials/docs-tree.html | 21 +++++++++++++++++++++ 6 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 layouts/hardenedpass/list.html create mode 100644 layouts/hardenedpass/single.html create mode 100644 layouts/partials/docs-nav.html create mode 100644 layouts/partials/docs-pager.html create mode 100644 layouts/partials/docs-tree.html (limited to 'layouts') diff --git a/layouts/hardenedpass/list.html b/layouts/hardenedpass/list.html new file mode 100644 index 0000000..0be5731 --- /dev/null +++ b/layouts/hardenedpass/list.html @@ -0,0 +1,22 @@ +{{ define "main" }} +
+
+ {{ partial "docs-nav.html" . }} +
+ {{ partial "breadcrumb.html" . }} +

{{ .Title }}

+ {{ with .Content }} +
{{ . }}
+ {{ end }} +
    + {{ range .Pages.ByWeight }} +
  • + {{ .Title }} + {{ with .Description }}

    {{ . }}

    {{ end }} +
  • + {{ end }} +
+
+
+
+{{ end }} diff --git a/layouts/hardenedpass/single.html b/layouts/hardenedpass/single.html new file mode 100644 index 0000000..123070f --- /dev/null +++ b/layouts/hardenedpass/single.html @@ -0,0 +1,15 @@ +{{ define "main" }} +
+
+ {{ partial "docs-nav.html" . }} +
+ {{ partial "breadcrumb.html" . }} +

{{ .Title }}

+
+ {{ .Content }} +
+ {{ partial "docs-pager.html" . }} +
+
+
+{{ end }} diff --git a/layouts/index.json b/layouts/index.json index 891641a..778d1ba 100644 --- a/layouts/index.json +++ b/layouts/index.json @@ -1,6 +1,7 @@ {{- $articles := where .Site.RegularPages "Section" "articles" -}} {{- $projects := where .Site.RegularPages "Section" "slackware" -}} -{{- $articles = ($articles | append $projects).ByDate.Reverse -}} +{{- $docs := where .Site.RegularPages "Section" "hardenedpass" -}} +{{- $articles = ($articles | append $projects | append $docs).ByDate.Reverse -}} [ {{- range $index, $article := $articles -}} { diff --git a/layouts/partials/docs-nav.html b/layouts/partials/docs-nav.html new file mode 100644 index 0000000..80dc381 --- /dev/null +++ b/layouts/partials/docs-nav.html @@ -0,0 +1,25 @@ +{{/* The tree and table of contents render twice, so Hugo's id on the table of contents goes. */}} +{{ $toc := replace .TableOfContents ` id="TableOfContents"` "" | safeHTML }} +{{ $hasToc := gt (len .Fragments.Headings) 0 }} +
+
+ {{ i18n "docsMenu" }} +
{{ partial "docs-tree.html" . }}
+
+ {{ if $hasToc }} +
+ {{ i18n "docsOnThisPage" }} +
{{ $toc }}
+
+ {{ end }} +
+ diff --git a/layouts/partials/docs-pager.html b/layouts/partials/docs-pager.html new file mode 100644 index 0000000..e44b570 --- /dev/null +++ b/layouts/partials/docs-pager.html @@ -0,0 +1,10 @@ +{{/* Pages.Next steps toward index 0, so reversing makes "next" the following page. */}} +{{ $pages := (site.GetPage "/hardenedpass").RegularPagesRecursive.ByWeight.Reverse }} +{{ $prev := $pages.Prev . }} +{{ $next := $pages.Next . }} +{{ if or $prev $next }} + +{{ end }} diff --git a/layouts/partials/docs-tree.html b/layouts/partials/docs-tree.html new file mode 100644 index 0000000..bdc1c07 --- /dev/null +++ b/layouts/partials/docs-tree.html @@ -0,0 +1,21 @@ +{{ $current := . }} +{{ $root := site.GetPage "/hardenedpass" }} + -- cgit v1.2.3