From a70083fb23ad51dde285d55b6792beab4021fc89 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sun, 2 Mar 2025 11:14:24 +0800 Subject: Recursive navigation --- assets/style.css | 12 ++++-------- layouts/_default/baseof.html | 22 +--------------------- layouts/partials/recursive_nav.html | 12 ++++++++++++ 3 files changed, 17 insertions(+), 29 deletions(-) create mode 100644 layouts/partials/recursive_nav.html diff --git a/assets/style.css b/assets/style.css index 0ac750e..bb7cbdc 100644 --- a/assets/style.css +++ b/assets/style.css @@ -50,17 +50,13 @@ aside#sidebar a:visited { color: var(--fg); } - -aside#sidebar > ul > li:not(first-child) { - margin-top: 1rem; -} - -aside#sidebar > ul { +aside#sidebar ul { list-style: none; + padding-left: 1rem; } -aside#sidebar ul { - padding-left: 1rem; +aside#sidebar > ul > li:not(first-child) { + margin-top: 1rem; } aside#sidebar > ul { diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 3fbc126..c6e0e3b 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -12,27 +12,7 @@

{{ .Site.Title }}

- {{ $currentPage := . }} - + {{ partial "recursive_nav.html" (dict "currentPage" . "pages" .Site.Sections) }}