diff --git a/exampleSite/config.toml b/exampleSite/config.toml index cb92d7be3b..45a9cfeadb 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -31,6 +31,7 @@ title = "Hugo Relearn Documentation" description = "Documentation for Hugo Relearn Theme" author = "Sören Weber" showVisitedLinks = true + collapsibleMenu = true disableBreadcrumb = false disableNextPrev = false disableLandingPageButton = true diff --git a/exampleSite/content/basics/configuration/_index.en.md b/exampleSite/content/basics/configuration/_index.en.md index f766047712..77bceb0bd6 100644 --- a/exampleSite/content/basics/configuration/_index.en.md +++ b/exampleSite/content/basics/configuration/_index.en.md @@ -70,6 +70,8 @@ Note that some of these parameters are explained in details in other sections of custom_css = ["css/foo.css", "css/bar.css"] # Change the title separator. Default to "::". titleSeparator = "-" + # If set to true, the menu in the sidebar will be displayed in a collapsible tree view. + collapsibleMenu = false ``` ## A word on running your site in a subfolder diff --git a/exampleSite/content/basics/migration/_index.en.md b/exampleSite/content/basics/migration/_index.en.md index 4fc255c113..fa4ea26f85 100644 --- a/exampleSite/content/basics/migration/_index.en.md +++ b/exampleSite/content/basics/migration/_index.en.md @@ -18,6 +18,8 @@ This document shows you what's new in the latest release. For a detailed list of - **Breaking**: If you had previously overwritten the `custom-footer.html` partial to add visual elements below the content of your page, you have to move this content to the new partial `content-footer.html`. `custom-footer.html` was never meant to contain HTML other than additional styles and JavaScript. +- **New**: If you prefer expandable/collapsible menu items, you can now set `collapsibleMenu=true` in your `config.toml`. This will add arrows to all menu items that contain sub menus. The menu will expand/collapse without navigation if you click on an arrow. + - **New**: You can activate [print support]({{%relref "basics/configuration#activate-print-support" %}}) in your `config.toml` to add the capability to print whole chapters or even the complete site. --- diff --git a/exampleSite/content/shortcodes/children/children-1/children-1-1/_index.en.md b/exampleSite/content/shortcodes/children/children-1/children-1-1/_index.en.md index 4009c71dfd..1140472cf0 100644 --- a/exampleSite/content/shortcodes/children/children-1/children-1-1/_index.en.md +++ b/exampleSite/content/shortcodes/children/children-1/children-1-1/_index.en.md @@ -1,5 +1,5 @@ +++ -alwaysopen = false +alwaysopen = true description = "This is a demo child page" tags = ["children", "non-hidden"] title = "page 1-1" diff --git a/exampleSite/content/shortcodes/children/children-1/children-1-1/_index.pir.md b/exampleSite/content/shortcodes/children/children-1/children-1-1/_index.pir.md index 761f398224..c4a9d49c65 100644 --- a/exampleSite/content/shortcodes/children/children-1/children-1-1/_index.pir.md +++ b/exampleSite/content/shortcodes/children/children-1/children-1-1/_index.pir.md @@ -1,5 +1,5 @@ +++ -alwaysopen = false +alwaysopen = true descrption = "This be a demo child plank" tags = ["children", "non-hidden"] title = "Plank 1-1" diff --git a/layouts/partials/content-print.html b/layouts/partials/content-print.html index 07abccb2a6..e7c28fafab 100644 --- a/layouts/partials/content-print.html +++ b/layouts/partials/content-print.html @@ -1,8 +1,8 @@ -{{- $isActive := .IsHome }} {{- $currentNode := . }} +{{- $isActive := .IsHome }} +{{- $pages := .Site.Home.Sections }} {{- $defaultOrdersectionsby := .Site.Params.ordersectionsby | default "weight" }} {{- $currentOrdersectionsby := .Site.Home.Params.ordersectionsby | default $defaultOrdersectionsby }} -{{- $pages := .Site.Home.Sections }} {{- if $isActive }} {{- template "section-print" dict "sect" . "currentnode" $currentNode }} {{- if or .IsHome .Params.chapter $pages }} @@ -24,24 +24,24 @@ {{- end }} {{- end }} {{- define "section-tree-print" }} - {{- $isActive := .isActive }} {{- $currentNode := .currentnode }} + {{- $isActive := .isActive }} {{- $currentFileRelPermalink := .currentnode.RelPermalink }} {{- with .sect }} {{- $currentIsActive := eq .RelPermalink $currentFileRelPermalink }} {{- $isActive = or $currentIsActive $isActive }} + {{- $pages := .Pages }} + {{- if .Page.IsHome }} + {{- $pages = .Sections }} + {{- else if .Page.Sections}} + {{- $pages = (.Pages | union .Sections) }} + {{- end }} {{- $relearnIsHiddenFrom := index ($currentNode.Scratch.Get "relearnIsHiddenFrom") .RelPermalink }} {{- $hidden := and $relearnIsHiddenFrom (not $.showhidden) (not (.IsAncestor $currentNode)) }} {{- if $hidden }} {{- else if or .IsSection .IsHome }} {{- $defaultOrdersectionsby := .Site.Params.ordersectionsby | default "weight" }} {{- $currentOrdersectionsby := .Params.ordersectionsby | default $defaultOrdersectionsby }} - {{- $pages := .Pages }} - {{- if .Page.IsHome }} - {{- $pages = .Sections }} - {{- else if .Page.Sections}} - {{- $pages = (.Pages | union .Sections) }} - {{- end }} {{- if $isActive }} {{- template "section-print" dict "sect" . "currentnode" $currentNode }} {{- if or .IsHome .Params.chapter $pages }} diff --git a/layouts/partials/menu.html b/layouts/partials/menu.html index f3a3f8f481..71680d5bfa 100644 --- a/layouts/partials/menu.html +++ b/layouts/partials/menu.html @@ -20,7 +20,7 @@ {{- end }}