From c6f1071410b420a891437fe0fedc908b1e21543c Mon Sep 17 00:00:00 2001 From: Matt Dodson <47385188+MattDodsonEnglish@users.noreply.github.com> Date: Tue, 16 Jul 2024 14:19:42 -0300 Subject: [PATCH] [Feat] site, add param to hide pages --- CONTRIBUTING.md | 1 + themes/hugo-docs/layouts/partials/sidebar.html | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7066d886a..0ca7f5148 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,6 +19,7 @@ Each page has the following frontmatter: - `weight`: The page's relative position in the menu. Heavier weights "sink" to lower on the page. - `categories`: (Optional) Meta-data about the topic - `aliases`: URIs from old pages. Configure redirects here. +- `hidden`: If `true` page does not display in sidebar. Works only on leaf pages. - `menu.main`: An object that configures the sidebar main menu properties - `name`: (Optional) The title of the page as it appears in the sidebar. Default is `title` - `identifier`: How to reference the page in menu configs, and relrefs and other shortcodes diff --git a/themes/hugo-docs/layouts/partials/sidebar.html b/themes/hugo-docs/layouts/partials/sidebar.html index fea1ce1e9..41c1a056e 100644 --- a/themes/hugo-docs/layouts/partials/sidebar.html +++ b/themes/hugo-docs/layouts/partials/sidebar.html @@ -19,12 +19,16 @@ {{ else }} - {{ .Name }} + {{ if not .Page.Params.Hidden }} + {{ .Name }} + {{ end }} {{ end }} {{ end }}