diff --git a/exampleSite/content/docs/guide/configuration.md b/exampleSite/content/docs/guide/configuration.md index 25e70009..f4ddd67d 100644 --- a/exampleSite/content/docs/guide/configuration.md +++ b/exampleSite/content/docs/guide/configuration.md @@ -90,6 +90,16 @@ params: For the main sidebar, it is automatically generated from the structure of the content directory. See the [Organize Files](/docs/guide/organize-files) page for more details. +To exclude a single page from the left sidebar, set the `sidebar.exclude` parameter in the front matter of the page: + +```yaml {filename="content/docs/guide/configuration.md"} +--- +title: Configuration +sidebar: + exclude: true +--- +``` + ### Extra Links Sidebar extra links are defined under the `menu.sidebar` section in the config file: diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index bdd279bd..efc85260 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -6,9 +6,14 @@ {{- $sidebarClass := cond $disableSidebar (cond $displayPlaceholder "md:hidden xl:block" "md:hidden") "md:sticky" -}} {{- $navRoot := cond (eq site.Home.Type "docs") site.Home $context.FirstSection -}} -{{- $navPages := union $navRoot.RegularPages $navRoot.Sections -}} {{- $pageURL := $context.RelPermalink -}} +{{/* EXPERIMENTAL */}} +{{- if .context.Params.sidebar.hide -}} + {{- $disableSidebar = true -}} + {{- $displayPlaceholder = true -}} +{{- end -}} +