From 9b5f3fad7068298265dbbc8a65077f7917a090a5 Mon Sep 17 00:00:00 2001 From: aethrvmn Date: Sun, 21 Sep 2025 00:27:35 +0200 Subject: updated hugo-book theme --- .../layouts/_partials/docs/menu-filetree.html | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 themes/hugo-book/layouts/_partials/docs/menu-filetree.html (limited to 'themes/hugo-book/layouts/_partials/docs/menu-filetree.html') diff --git a/themes/hugo-book/layouts/_partials/docs/menu-filetree.html b/themes/hugo-book/layouts/_partials/docs/menu-filetree.html new file mode 100644 index 0000000..5105aa8 --- /dev/null +++ b/themes/hugo-book/layouts/_partials/docs/menu-filetree.html @@ -0,0 +1,49 @@ +{{ $bookSection := default "docs" .Site.Params.BookSection }} +{{ if eq $bookSection "*" }} + {{ $bookSection = "/" }}{{/* Backward compatibility */}} +{{ end }} + +{{ with .Site.GetPage $bookSection }} + {{ template "book-section-children" (dict "Section" . "CurrentPage" $) }} +{{ end }} + +{{ define "book-section-children" }}{{/* (dict "Section" .Section "CurrentPage" .CurrentPage) */}} + +{{ end }} + +{{ define "book-page-link" }}{{/* (dict "Page" .Page "CurrentPage" .CurrentPage) */}} + {{ $current := eq .CurrentPage .Page }} + {{ $ancestor := .Page.IsAncestor .CurrentPage }} + + {{ if .Page.Params.BookCollapseSection }} + + + {{ else if .Page.Params.BookHref }} + + {{- partial "docs/title" .Page -}} + + {{ else if .Page.Content }} + + {{- partial "docs/title" .Page -}} + + {{ else }} + {{- partial "docs/title" .Page -}} + {{ end }} +{{ end }} -- cgit v1.2.3