menu: optionally disable index pages for sections #642

This commit is contained in:
Sören Weber 2023-09-21 17:23:41 +02:00
parent bb68b7b28a
commit 493e23ebe1
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
20 changed files with 128 additions and 76 deletions

View file

@ -18,6 +18,20 @@ This document shows you what's new in the latest release. For a detailed list of
--- ---
## 5.22.0 (2023-09-21) {#5220}
- {{% badge style="note" title=" " %}}Change{{% /badge %}} You can now have structural sections in the hierarchical menu without generating a page for it.
This can come in handy, if content for such a section page doesn't make much sense to you. See [the documentation]({{% relref "cont/pages#disable-section-pages" %}}) for how to do this.
This feature may require you to make changes to your existing installation if you are already using _[shortcuts to pages inside of your project]({{% relref "cont/menushortcuts#shortcuts-to-pages-inside-of-your-project" %}})_ with a _headless branch parent_.
In this case it is advised to remove the `title` from the headless branch parent's frontmatter, as it will otherwise appear in your breadcrumbs.
- {{% badge style="info" icon="plus-circle" title=" " %}}New{{% /badge %}} The above change has a nice side effect. It is now possible to overwrite the setting for `collapsibleMenu` of your `config.toml` inside of a page's frontmatter.
---
## 5.21.0 (2023-09-18) {#5210} ## 5.21.0 (2023-09-18) {#5210}
- {{% badge style="note" title=" " %}}Change{{% /badge %}} We made changes to the menu footer to improve alignment with the menu items in most cases. Care was taken not to break your existing overwritten footer. Anyways, if you have your `menu-footer.html` [partial overridden]({{%relref "basics/customization" %}}), you may want to review the styling (eg. margins/paddings) of your partial. - {{% badge style="note" title=" " %}}Change{{% /badge %}} We made changes to the menu footer to improve alignment with the menu items in most cases. Care was taken not to break your existing overwritten footer. Anyways, if you have your `menu-footer.html` [partial overridden]({{%relref "basics/customization" %}}), you may want to review the styling (eg. margins/paddings) of your partial.
@ -245,24 +259,32 @@ This document shows you what's new in the latest release. For a detailed list of
It was later discovered, that this causes pages only meant to be displayed in the `More` section of the menu and stored directly inside your `content` directory to now show up in the menu aswell. It was later discovered, that this causes pages only meant to be displayed in the `More` section of the menu and stored directly inside your `content` directory to now show up in the menu aswell.
To get rid of this undesired behavior you have two choices: To [get rid]/]({{% relref "cont/menushortcuts#shortcuts-to-pages-inside-of-your-project" %}}) of this undesired behavior you have two choices:
1. Make the page file for the `More` section a [headless branch bundle](https://gohugo.io/content-management/page-bundles/#headless-bundle) (contained in its own subdirectory and called `_index.md`) and add the following frontmatter configuration to the file (see exampleSite's `content/showcase`). This causes its content to **not** be contained in the sitemap. 1. Make the page file a [headless branch bundle](https://gohugo.io/content-management/age-bundles/#headless-bundle) (contained in its own subdirectory and called `_index.md`) and add the following frontmatter configuration to the file (see exampleSite's `content/showcase/_index.en.md`). This causes its content to **not** be ontained in the sitemap.
````toml ````toml
title = "Showcase"
[_build]
render = "always"
list = "never"
publishResources = true
````
2. Store the page file for below a parent headless branch bundle and add the following frontmatter to he **parent** (see exampleSite's `content/more/_index.en.md`).
````toml
# title = "More" ### ATTENTION: Don't give this page a title as this will cause it to be in the breadcrumbs - a thing you most likely don't want
[_build] [_build]
render = "never" render = "never"
list = "never" list = "never"
publishResources = false publishResources = false
```` ````
2. Store the page file for the `More` section below a parent headless branch bundle and add the following frontmatter to the **parent**. In this case, the file itself can be a branch bundle, leaf bundle or simple page (see exampleSite's `content/more/` and `content/more/credits`). This causes its content to be contained in the sitemap. In this case, the file itself can be a branch bundle, leaf bundle or simple page (see exampleSite's `content/more/credits.en.md`). This causes its content to be contained in the sitemap.
````toml ````toml
[_build] title = "Credits"
render = "always"
list = "never"
publishResources = true
```` ````
- {{% badge style="note" title=" " %}}Change{{% /badge %}} The required folder name for the [`attachments` shortcode]({{% relref "shortcodes/attachments" %}}) was changed for leaf bundles. - {{% badge style="note" title=" " %}}Change{{% /badge %}} The required folder name for the [`attachments` shortcode]({{% relref "shortcodes/attachments" %}}) was changed for leaf bundles.

View file

@ -135,20 +135,28 @@ Read more about [hugo menu](https://gohugo.io/extras/menus/) and [hugo multiling
If you have shortcuts to pages inside of your project and you don't want them to show up in page menu section, you have two choices: If you have shortcuts to pages inside of your project and you don't want them to show up in page menu section, you have two choices:
1. Make the page file for the shortcut section a [headless branch bundle](https://gohugo.io/content-management/age-bundles/#headless-bundle) (contained in its own subdirectory and called `_index.md`) and add the following frontmatter configuration to the file (see exampleSite's `content/showcase`). This causes its content to **not** be ontained in the sitemap. 1. Make the page file for the shortcut a [headless branch bundle](https://gohugo.io/content-management/age-bundles/#headless-bundle) (contained in its own subdirectory and called `_index.md`) and add the following frontmatter configuration to the file (see exampleSite's `content/showcase/_index.en.md`). This causes its content to **not** be ontained in the sitemap.
````toml ````toml
title = "Showcase"
[_build]
render = "always"
list = "never"
publishResources = true
````
2. Store the page file for the shortcut below a parent headless branch bundle and add the following frontmatter to he **parent** (see exampleSite's `content/more/_index.en.md`).
````toml
# title = "More" ### ATTENTION: Don't give this page a title as this will cause it to be in the breadcrumbs - a thing you most likely don't want
[_build] [_build]
render = "never" render = "never"
list = "never" list = "never"
publishResources = false publishResources = false
```` ````
2. Store the page file for the shortcut section below a parent headless branch bundle and add the following frontmatter to he **parent**. In this case, the file itself can be a branch bundle, leaf bundle or simple page (see exampleSite's content/more/` and `content/more/credits`). This causes its content to be contained in the sitemap. In this case, the file itself can be a branch bundle, leaf bundle or simple page (see exampleSite's `content/more/credits.en.md`). This causes its content to be contained in the sitemap.
````toml ````toml
[_build] title = "Credits"
render = "always"
list = "never"
publishResources = true
```` ````

View file

@ -64,6 +64,8 @@ The Relearn theme uses the following parameters on top of Hugo ones:
disableToc = false disableToc = false
# If set, this will be used for the page's menu entry (instead of the `title` attribute) # If set, this will be used for the page's menu entry (instead of the `title` attribute)
menuTitle = "" menuTitle = ""
# If set to true, the menu in the sidebar will be displayed in a collapsible tree view. Although the functionality works with old browsers (IE11), the display of the expander icons is limited to modern browsers
collapsibleMenu = false
# If set, this will explicitly override common rules for the expand state of a page's menu entry # If set, this will explicitly override common rules for the expand state of a page's menu entry
alwaysopen = true alwaysopen = true
# If set, this will explicitly override common rules for the sorting order of a page's submenu entries # If set, this will explicitly override common rules for the sorting order of a page's submenu entries
@ -146,3 +148,17 @@ The theme generates the menu based on the following rules:
- all remaining entries are not shown - all remaining entries are not shown
You can see this feature in action on the example page for [children shortcode]({{< relref "shortcodes/children" >}}) and its children pages. You can see this feature in action on the example page for [children shortcode]({{< relref "shortcodes/children" >}}) and its children pages.
## Disable Section Pages
You may want to structure your pages in a hierachical way but don't want to generate pages for those sections? The theme got you covered.
To stay with the initial example: Suppose you want `level-one` appear in the sidebar but don't want to generate a page for it. So the entry in the sidebar should not be clickable but should show an expander.
For this, open `content/level-one/_index.md` and add the following frontmatter
````toml
collapsibleMenu = true # this adds the expander to the menu entry if not already set in your config.toml
[_build]
render = "never" # no page will be generated so the page does not have a url
````

View file

@ -1,5 +1,4 @@
+++ +++
title = "More"
[_build] [_build]
render = "never" render = "never"
list = "never" list = "never"

View file

@ -1,5 +1,4 @@
+++ +++
title = "Morrre"
[_build] [_build]
render = "never" render = "never"
list = "never" list = "never"

View file

@ -2,7 +2,7 @@
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }} {{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }}
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml"> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
{{- range .Data.Pages }} {{- range .Data.Pages }}
{{- if and .Title (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSeoHiddenPages true) ) }} {{- if and .Title .RelPermalink (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSeoHiddenPages true) ) }}
<url> <url>
<loc>{{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true) }}</loc> <loc>{{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true) }}</loc>
{{- if not .Lastmod.IsZero }} {{- if not .Lastmod.IsZero }}

View file

@ -24,7 +24,7 @@
{{- $len := 0 }} {{- $len := 0 }}
{{- range .Pages }} {{- range .Pages }}
{{- $c:=""}}{{/* count pages of term */}} {{- $c:=""}}{{/* count pages of term */}}
{{- if and .Title (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableTagHiddenPages true) ) }} {{- if and .Title .RelPermalink (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableTagHiddenPages true) ) }}
{{- $len = add $len 1 }} {{- $len = add $len 1 }}
{{- end }} {{- end }}
{{- end }} {{- end }}

View file

@ -14,7 +14,7 @@
<ul class="columnize"> <ul class="columnize">
{{- range sort .Pages "Title" }} {{- range sort .Pages "Title" }}
{{- $c:=""}}{{/* display pages of a term */}} {{- $c:=""}}{{/* display pages of a term */}}
{{- if and .Title (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableTagHiddenPages true) ) }} {{- if and .Title .RelPermalink (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableTagHiddenPages true) ) }}
<li><a href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}">{{ .Title }}</a></li> <li><a href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}">{{ .Title }}</a></li>
{{- end }} {{- end }}
{{- end }} {{- end }}

View file

@ -103,7 +103,9 @@
{{- range seq $depth }} {{- range seq $depth }}
{{- $to = $to.Parent }} {{- $to = $to.Parent }}
{{- if $to }} {{- if $to }}
{{- if $to.Title }}
{{- $breadcrumb = $breadcrumb | append $to }} {{- $breadcrumb = $breadcrumb | append $to }}
{{- end }}
{{- else }} {{- else }}
{{- break }} {{- break }}
{{- end }} {{- end }}
@ -116,8 +118,6 @@
{{- $depth := 0 }} {{- $depth := 0 }}
{{- range $i, $e := $breadcrumbReversed }} {{- range $i, $e := $breadcrumbReversed }}
{{- $to := $e }} {{- $to := $e }}
{{- $ispublished := gt (int (len $to.Permalink)) 0 }}
{{- if $ispublished }}
{{- $depth = add $depth 1 }} {{- $depth = add $depth 1 }}
{{- $title := $to.Title }} {{- $title := $to.Title }}
{{- if eq .Kind "taxonomy" }} {{- if eq .Kind "taxonomy" }}
@ -141,5 +141,4 @@
{{- printf "<li" | safeHTML }} {{- printf "<li" | safeHTML }}
itemscope itemtype="https://schema.org/ListItem" itemprop="itemListElement">{{ if $link }}<a itemprop="item" href="{{ $url }}">{{end}}<span itemprop="name">{{ $title }}</span>{{ if $link }}</a>{{ end }}<meta itemprop="position" content="{{ $depth }}">{{ if not $last }}{{ (printf "&nbsp;%s&nbsp;" (default ">" .Site.Params.breadcrumbSeparator)) | safeHTML }}{{ end }}</li> itemscope itemtype="https://schema.org/ListItem" itemprop="itemListElement">{{ if $link }}<a itemprop="item" href="{{ $url }}">{{end}}<span itemprop="name">{{ $title }}</span>{{ if $link }}</a>{{ end }}<meta itemprop="position" content="{{ $depth }}">{{ if not $last }}{{ (printf "&nbsp;%s&nbsp;" (default ">" .Site.Params.breadcrumbSeparator)) | safeHTML }}{{ end }}</li>
{{- end }} {{- end }}
{{- end }}
{{- end }} {{- end }}

View file

@ -30,7 +30,7 @@
</div> </div>
<div id="content-wrapper" class="highlightable"> <div id="content-wrapper" class="highlightable">
<div id="topics"> <div id="topics">
<ul class="enlarge morespace{{ if .Site.Params.collapsibleMenu }} collapsible-menu{{ end }}"> <ul class="enlarge morespace collapsible-menu">
{{- $defaultOrdersectionsby := .Site.Params.ordersectionsby | default "weight" }} {{- $defaultOrdersectionsby := .Site.Params.ordersectionsby | default "weight" }}
{{- $currentOrdersectionsby := .Site.Home.Params.ordersectionsby | default $defaultOrdersectionsby }} {{- $currentOrdersectionsby := .Site.Home.Params.ordersectionsby | default $defaultOrdersectionsby }}
{{- $defaultAlwaysopen := .Site.Params.alwaysopen | default false }} {{- $defaultAlwaysopen := .Site.Params.alwaysopen | default false }}
@ -166,14 +166,17 @@
{{- end }} {{- end }}
{{- safeHTML .Params.head }} {{- safeHTML .Params.head }}
{{- if $numberOfVisibleChildren }} {{- if $numberOfVisibleChildren }}
{{- $title := or .Params.menuTitle .LinkTitle .Title }}
{{- $url := partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}
{{- $defaultOrdersectionsby := .Site.Params.ordersectionsby | default "weight" }} {{- $defaultOrdersectionsby := .Site.Params.ordersectionsby | default "weight" }}
{{- $currentOrdersectionsby := .Params.ordersectionsby | default $defaultOrdersectionsby }} {{- $currentOrdersectionsby := .Params.ordersectionsby | default $defaultOrdersectionsby }}
{{- $isCollapsible := or (.Params.collapsibleMenu | default .Site.Params.collapsibleMenu) (not $url) }}
{{- $currentAlwaysopen := .Params.alwaysopen | default $alwaysopen }} {{- $currentAlwaysopen := .Params.alwaysopen | default $alwaysopen }}
{{- $pageHash := md5 .Page }} {{- $pageHash := md5 .Page }}
{{- $isOpen := or $currentAlwaysopen $isSelf $isAncestor }} {{- $isOpen := or $currentAlwaysopen $isSelf $isAncestor }}
<li data-nav-id="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}" class="{{if $isActive }}active {{end}}{{if (or $isSelf $isAncestor) }}parent {{end}}{{if $currentAlwaysopen}}alwaysopen{{end}}">{{ if .Site.Params.collapsibleMenu }}<input type="checkbox" id="section-{{ $pageHash }}" aria-controls="subsections-{{ $pageHash }}"{{ if $isOpen }} checked{{ end }}><label for="section-{{ $pageHash }}"><i class="fas fa-chevron-down"></i><i class="fas fa-chevron-right"></i><span class="a11y-only">{{ T "Submenu" ( or .Params.menuTitle .LinkTitle .Title ) }}</span></label>{{ end }}<a class="padding" href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}"> <li data-nav-id="{{ $url }}" class="{{if $isActive }}active {{end}}{{if (or $isSelf $isAncestor) }}parent {{end}}{{if $currentAlwaysopen}}alwaysopen{{end}}">{{ if $isCollapsible }}<input type="checkbox" id="section-{{ $pageHash }}" aria-controls="subsections-{{ $pageHash }}"{{ if $isOpen }} checked{{ end }}><label for="section-{{ $pageHash }}"><i class="fas fa-chevron-down"></i><i class="fas fa-chevron-right"></i><span class="a11y-only">{{ T "Submenu" $title }}</span></label>{{ end }}{{ if $url }}<a class="padding" href="{{ $url }}">{{ else }}<span class="padding">{{ end }}
{{- partial "menu-pre.html" . }}{{ or .Params.menuTitle .LinkTitle .Title }}{{ partial "menu-post.html" . }} {{- partial "menu-pre.html" . }}{{ $title }}{{ partial "menu-post.html" . }}
{{- if $showvisitedlinks }}<i class="fas fa-check read-icon"></i>{{ end }}</a><ul id="subsections-{{ $pageHash }}" class="morespace{{ if .Site.Params.collapsibleMenu }} collapsible-menu{{ end }}"> {{- if $url }}{{ if $showvisitedlinks }}<i class="fas fa-check read-icon"></i>{{ end }}</a>{{ else }}</span>{{ end }}<ul id="subsections-{{ $pageHash }}" class="morespace collapsible-menu">
{{- $defaultAlwaysopen := .Site.Params.alwaysopen | default true }} {{- $defaultAlwaysopen := .Site.Params.alwaysopen | default true }}
{{- if eq $currentOrdersectionsby "title" }} {{- if eq $currentOrdersectionsby "title" }}
{{- range $pages.ByTitle }} {{- range $pages.ByTitle }}
@ -185,9 +188,11 @@
{{- end }} {{- end }}
{{- end }}</ul></li> {{- end }}</ul></li>
{{- else }} {{- else }}
<li data-nav-id="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}" class="{{if $isActive }}active{{end}}"><a class="padding" href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}"> {{- $title := or .Params.menuTitle .LinkTitle .Title }}
{{- partial "menu-pre.html" . }}{{ or .Params.menuTitle .LinkTitle .Title }}{{ partial "menu-post.html" . }} {{- $url := partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}
{{- if $showvisitedlinks }}<i class="fas fa-check read-icon"></i>{{ end }}</a></li> <li data-nav-id="{{ $url }}" class="{{if $isActive }}active{{end}}">{{ if $url }}<a class="padding" href="{{ $url }}">{{ else }}<span class="padding">{{ end }}
{{- partial "menu-pre.html" . }}{{ $title }}{{ partial "menu-post.html" . }}
{{- if $url }}{{ if $showvisitedlinks }}<i class="fas fa-check read-icon"></i>{{ end }}</a>{{ else }}</span>{{ end }}</li>
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- end }} {{- end }}

View file

@ -1,7 +1,13 @@
{{- $page := .page }} {{- $page := .page }}
{{- $outputFormat := .outputFormat }} {{- $outputFormat := .outputFormat }}
{{- $c:=""}}{{/* if we have a relative link in a print page, our print URL is one level to deep; so we are making it absolute to our page by prepending the page's permalink */}} {{- $content := "" }}
{{- $link_prefix := strings.TrimRight "/" $page.RelPermalink }} {{- $url := partial "relLangPrettyUglyURL.hugo" (dict "to" $page) }}
{{- $content := partial "output-partial.hugo" (dict "base" "content" "page" $page "parameter" $page "outputFormat" $outputFormat) }} {{- if $url }}
{{- $content = replaceRE "((?:src|href)\\s*=(?:\\s*[\"']\\s*)?)(\\.[^\"'\\s>]*|[\\w]+[^\"'\\s>:]*)([\"'\\s>])" (printf "${1}%s/${2}${3}" $link_prefix) $content }} {{- $c:=""}}{{/* if we have a relative link in a print page, our print URL is one level to deep; so we are making it absolute to our page by prepending the page's permalink */}}
{{- partial "output-partial.hugo" (dict "base" "article" "page" $page "parameter" (dict "page" $page "content" $content "outputFormat" $outputFormat) "outputFormat" $outputFormat) }} {{- $link_prefix := strings.TrimRight "/" $page.RelPermalink }}
{{- $content = partial "output-partial.hugo" (dict "base" "content" "page" $page "parameter" $page "outputFormat" $outputFormat) }}
{{- $content = replaceRE "((?:src|href)\\s*=(?:\\s*[\"']\\s*)?)(\\.[^\"'\\s>]*|[\\w]+[^\"'\\s>:]*)([\"'\\s>])" (printf "${1}%s/${2}${3}" $link_prefix) $content }}
{{- end }}
{{- if $page.Title }}
{{- partial "output-partial.hugo" (dict "base" "article" "page" $page "parameter" (dict "page" $page "content" $content "outputFormat" $outputFormat) "outputFormat" $outputFormat) }}
{{- end }}

View file

@ -20,12 +20,12 @@
{{- template "relearn-structure" dict "node" .Site.Home "currentnode" $currentNode "hiddenstem" false "hiddencurrent" false "defaultOrdersectionsby" (.Site.Params.ordersectionsby | default "weight") }} {{- template "relearn-structure" dict "node" .Site.Home "currentnode" $currentNode "hiddenstem" false "hiddencurrent" false "defaultOrdersectionsby" (.Site.Params.ordersectionsby | default "weight") }}
{{- define "relearn-structure" }} {{- define "relearn-structure" }}
{{- $currentNode := .currentnode }} {{- $currentNode := .currentnode }}
{{- $isSelf := eq $currentNode.RelPermalink .node.RelPermalink }} {{- $isSelf := eq $currentNode .node }}
{{- $isDescendant := and (not $isSelf) (.node.IsDescendant $currentNode) }} {{- $isDescendant := and (not $isSelf) (.node.IsDescendant $currentNode) }}
{{- $isAncestor := and (not $isSelf) (.node.IsAncestor $currentNode) }} {{- $isAncestor := and (not $isSelf) (.node.IsAncestor $currentNode) }}
{{- $isOther := and (not $isDescendant) (not $isSelf) (not $isAncestor) }} {{- $isOther := and (not $isDescendant) (not $isSelf) (not $isAncestor) }}
{{- $isChildren := and (.node.Parent) (eq $currentNode.RelPermalink .node.Parent.RelPermalink) }} {{- $isChildren := eq $currentNode .node.Parent }}
{{- if $isSelf }} {{- if $isSelf }}
{{- $currentNode.Scratch.Set "relearnIsSelfFound" true }} {{- $currentNode.Scratch.Set "relearnIsSelfFound" true }}
{{- end}} {{- end}}
@ -44,9 +44,9 @@
{{- $currentNode.Scratch.SetInMap "relearnIsHiddenFrom" .node.RelPermalink $hidden_current_stem }} {{- $currentNode.Scratch.SetInMap "relearnIsHiddenFrom" .node.RelPermalink $hidden_current_stem }}
{{- if not $hidden_from_current }} {{- if not $hidden_from_current }}
{{- if $isPreSelf }} {{- if and $isPreSelf .node.RelPermalink }}
{{- $currentNode.Scratch.Set "relearnPrevPage" .node }} {{- $currentNode.Scratch.Set "relearnPrevPage" .node }}
{{- else if and $isPostSelf (eq ($currentNode.Scratch.Get "relearnNextPage") nil) }} {{- else if and $isPostSelf .node.RelPermalink (eq ($currentNode.Scratch.Get "relearnNextPage") nil) }}
{{- $currentNode.Scratch.Set "relearnNextPage" .node }} {{- $currentNode.Scratch.Set "relearnNextPage" .node }}
{{- end}} {{- end}}
{{- end }} {{- end }}

View file

@ -50,7 +50,7 @@
{{- if hasPrefix $.style "h" }} {{- if hasPrefix $.style "h" }}
{{- $num := sub ( int (trim $.style "h") ) 1 }} {{- $num := sub ( int (trim $.style "h") ) 1 }}
{{- $numn := add $num $.count }} {{- $numn := add $num $.count }}
{{ (printf "<h%d>" $numn)|safeHTML }}<a href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}">{{ .Title }}</a>{{ (printf "</h%d>" $numn)|safeHTML }} {{ (printf "<h%d>" $numn)|safeHTML }}{{ if .RelPermalink }}<a href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}">{{ .Title }}</a>{{ else }}<span>{{ .Title }}</span>{{ end }}{{ (printf "</h%d>" $numn)|safeHTML }}
{{- if $.description }} {{- if $.description }}
{{- if .Description -}} {{- if .Description -}}
<p>{{ .Description }}</p> <p>{{ .Description }}</p>
@ -60,7 +60,7 @@
{{- end }} {{- end }}
{{- else if eq $.style "li" }} {{- else if eq $.style "li" }}
{{ (printf "<%s>" $.style)|safeHTML }}<a href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}">{{ .Title }}</a> {{ (printf "<%s>" $.style)|safeHTML }}{{ if .RelPermalink }}<a href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}">{{ .Title }}</a>{{ else }}<span>{{ .Title }}</span>{{ end }}
{{- if $.description }} {{- if $.description }}
{{- if .Description -}} {{- if .Description -}}
<p>{{ .Description }}</p> <p>{{ .Description }}</p>
@ -70,7 +70,7 @@
{{- end }} {{- end }}
{{- else }} {{- else }}
{{ (printf "<%s>" $.style)|safeHTML }}<a href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}">{{ .Title }}</a>{{ (printf "</%s>" $.style)|safeHTML }} {{ (printf "<%s>" $.style)|safeHTML }}{{ if .RelPermalink }}<a href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}">{{ .Title }}</a>{{ else }}<span>{{ .Title }}</span>{{ end }}{{ (printf "</%s>" $.style)|safeHTML }}
{{- if $.description }} {{- if $.description }}
{{- if .Description -}} {{- if .Description -}}
<p>{{ .Description }}</p> <p>{{ .Description }}</p>

View file

@ -10,12 +10,8 @@
{{- if eq (T "Reading-direction" | default "ltr") "rtl" }} {{- if eq (T "Reading-direction" | default "ltr") "rtl" }}
{{- $endarrow = "🡐" }} {{- $endarrow = "🡐" }}
{{- end }} {{- end }}
{{- $ispublished := true }}
{{- with .Parent }}
{{- $ispublished = gt (int (len .Permalink)) 0 }}
{{- end }}
{{- $next := "" }} {{- $next := "" }}
{{- if or (ne $outputFormat "html") (not (and $ispublished (.Scratch.Get "relearnNextPage"))) }} {{- if or (ne $outputFormat "html") (not (.Scratch.Get "relearnNextPage")) }}
{{- else }} {{- else }}
{{- $next = .Scratch.Get "relearnNextPage" }} {{- $next = .Scratch.Get "relearnNextPage" }}
{{- end }} {{- end }}

View file

@ -10,13 +10,9 @@
{{- if eq (T "Reading-direction" | default "ltr") "rtl" }} {{- if eq (T "Reading-direction" | default "ltr") "rtl" }}
{{- $startarrow = "🡒" }} {{- $startarrow = "🡒" }}
{{- end }} {{- end }}
{{- $ispublished := true }}
{{- with .Parent }}
{{- $ispublished = gt (int (len .Permalink)) 0 }}
{{- end }}
{{- $prev := "" }} {{- $prev := "" }}
{{- if and (eq .RelPermalink .Site.Home.RelPermalink) (eq $outputFormat "html") }} {{- if and (eq .RelPermalink .Site.Home.RelPermalink) (eq $outputFormat "html") }}
{{- else if or (ne $outputFormat "html") (not (and $ispublished (.Scratch.Get "relearnPrevPage"))) (eq .Page.Kind "taxonomy") (eq .Page.Kind "term") }} {{- else if or (ne $outputFormat "html") (not (.Scratch.Get "relearnPrevPage")) (eq .Page.Kind "taxonomy") (eq .Page.Kind "term") }}
{{- $prev = .Site.Home }} {{- $prev = .Site.Home }}
{{- else }} {{- else }}
{{- $prev = .Scratch.Get "relearnPrevPage" }} {{- $prev = .Scratch.Get "relearnPrevPage" }}

View file

@ -106,6 +106,12 @@ body,
margin-top: 1.5rem; margin-top: 1.5rem;
padding-top: .75rem; padding-top: .75rem;
} }
h1 + .footline{
/* if we have no content in the page we remove the footer as it is of no real value in print */
display: none;
}
#body #body-inner .headline a, #body #body-inner .headline a,
#body #body-inner .footline a, #body #body-inner .footline a,
#body #body-inner .btn a { #body #body-inner .btn a {

View file

@ -270,7 +270,7 @@
#sidebar .collapsible-menu label, #sidebar .collapsible-menu label,
#sidebar .menu-control, #sidebar .menu-control,
#sidebar a { #sidebar :is( a, span ) {
color: rgba( 186, 186, 186, 1 ); /* var(--MENU-SECTIONS-LINK-color) */ color: rgba( 186, 186, 186, 1 ); /* var(--MENU-SECTIONS-LINK-color) */
} }

View file

@ -185,7 +185,7 @@ body #sidebar a:hover {
} }
body #sidebar li.active > label, body #sidebar li.active > label,
body #sidebar li.active > a { body #sidebar li.active > :is( a, span ) {
color: rgba( 255, 255, 255, 1 ); color: rgba( 255, 255, 255, 1 );
text-shadow: text-shadow:
0 0 1px rgba( 255, 255, 255, 1 ), 0 0 1px rgba( 255, 255, 255, 1 ),

View file

@ -1856,7 +1856,7 @@ article ul > li > input[type="checkbox"]:checked::before {
/* basic menu list styles (non-collapsible) */ /* basic menu list styles (non-collapsible) */
#sidebar ul > li > a { #sidebar ul > li > :is( a, span ) {
display: block; display: block;
position: relative; position: relative;
} }
@ -1879,7 +1879,7 @@ article ul > li > input[type="checkbox"]:checked::before {
padding-top: 0; padding-top: 0;
} }
#sidebar ul.enlarge > li > a { #sidebar ul.enlarge > li > :is( a, span ) {
font-size: 1.1rem; font-size: 1.1rem;
line-height: 2rem; line-height: 2rem;
} }
@ -1948,7 +1948,7 @@ article ul > li > input[type="checkbox"]:checked::before {
width: .6rem; width: .6rem;
} }
#sidebar ul.collapsible-menu > li > a { #sidebar ul.collapsible-menu > li > :is( a, span ) {
display: inline-block; display: inline-block;
width: 100%; width: 100%;
} }

View file

@ -49,7 +49,7 @@ a:hover,
#sidebar .collapsible-menu label, #sidebar .collapsible-menu label,
#sidebar .menu-control, #sidebar .menu-control,
#sidebar a { #sidebar :is( a, span ) {
color: var(--INTERNAL-MENU-SECTIONS-LINK-color); color: var(--INTERNAL-MENU-SECTIONS-LINK-color);
} }