From 1147a663e70aadb2578cbe601bc723d7cd939c5a Mon Sep 17 00:00:00 2001 From: aethrvmn Date: Sat, 30 Aug 2025 15:17:32 +0200 Subject: added non-content --- .../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..1494588 --- /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