mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
menu: optionally disable index pages for sections #642
This commit is contained in:
parent
bb68b7b28a
commit
493e23ebe1
20 changed files with 128 additions and 76 deletions
|
@ -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}
|
||||
|
||||
- {{% 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.
|
||||
|
||||
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
|
||||
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]
|
||||
render = "never"
|
||||
list = "never"
|
||||
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
|
||||
[_build]
|
||||
render = "always"
|
||||
list = "never"
|
||||
publishResources = true
|
||||
title = "Credits"
|
||||
````
|
||||
|
||||
- {{% badge style="note" title=" " %}}Change{{% /badge %}} The required folder name for the [`attachments` shortcode]({{% relref "shortcodes/attachments" %}}) was changed for leaf bundles.
|
||||
|
|
|
@ -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:
|
||||
|
||||
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
|
||||
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]
|
||||
render = "never"
|
||||
list = "never"
|
||||
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
|
||||
[_build]
|
||||
render = "always"
|
||||
list = "never"
|
||||
publishResources = true
|
||||
title = "Credits"
|
||||
````
|
||||
|
|
|
@ -64,6 +64,8 @@ The Relearn theme uses the following parameters on top of Hugo ones:
|
|||
disableToc = false
|
||||
# If set, this will be used for the page's menu entry (instead of the `title` attribute)
|
||||
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
|
||||
alwaysopen = true
|
||||
# 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
|
||||
|
||||
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
|
||||
````
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
+++
|
||||
title = "More"
|
||||
[_build]
|
||||
render = "never"
|
||||
list = "never"
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
+++
|
||||
title = "Morrre"
|
||||
[_build]
|
||||
render = "never"
|
||||
list = "never"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
{{- 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">
|
||||
{{- 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>
|
||||
<loc>{{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true) }}</loc>
|
||||
{{- if not .Lastmod.IsZero }}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
{{- $len := 0 }}
|
||||
{{- range .Pages }}
|
||||
{{- $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 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<ul class="columnize">
|
||||
{{- range sort .Pages "Title" }}
|
||||
{{- $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>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
|
@ -103,7 +103,9 @@
|
|||
{{- range seq $depth }}
|
||||
{{- $to = $to.Parent }}
|
||||
{{- if $to }}
|
||||
{{- $breadcrumb = $breadcrumb | append $to }}
|
||||
{{- if $to.Title }}
|
||||
{{- $breadcrumb = $breadcrumb | append $to }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- break }}
|
||||
{{- end }}
|
||||
|
@ -116,30 +118,27 @@
|
|||
{{- $depth := 0 }}
|
||||
{{- range $i, $e := $breadcrumbReversed }}
|
||||
{{- $to := $e }}
|
||||
{{- $ispublished := gt (int (len $to.Permalink)) 0 }}
|
||||
{{- if $ispublished }}
|
||||
{{- $depth = add $depth 1 }}
|
||||
{{- $title := $to.Title }}
|
||||
{{- if eq .Kind "taxonomy" }}
|
||||
{{- $title = i18n $to.Data.Plural }}
|
||||
{{- if not $title }}
|
||||
{{- $title = $to.Data.Plural }}
|
||||
{{- end }}
|
||||
{{- else if eq .Kind "term" }}
|
||||
{{- $title = i18n $to.Data.Singular }}
|
||||
{{- if not $title }}
|
||||
{{- $title = $to.Data.Singular }}
|
||||
{{- end }}
|
||||
{{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) $to.Title }}
|
||||
{{- end }}
|
||||
{{- $depth = add $depth 1 }}
|
||||
{{- $title := $to.Title }}
|
||||
{{- if eq .Kind "taxonomy" }}
|
||||
{{- $title = i18n $to.Data.Plural }}
|
||||
{{- if not $title }}
|
||||
{{- $title = $to.Site.Title }}
|
||||
{{- $title = $to.Data.Plural }}
|
||||
{{- end }}
|
||||
{{- $url := partial "relLangPrettyUglyURL.hugo" (dict "to" $to) }}
|
||||
{{- $last := eq $url $pageurl }}
|
||||
{{- $link := and $url (not $last) }}
|
||||
{{- 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 " %s " (default ">" .Site.Params.breadcrumbSeparator)) | safeHTML }}{{ end }}</li>
|
||||
{{- else if eq .Kind "term" }}
|
||||
{{- $title = i18n $to.Data.Singular }}
|
||||
{{- if not $title }}
|
||||
{{- $title = $to.Data.Singular }}
|
||||
{{- end }}
|
||||
{{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) $to.Title }}
|
||||
{{- end }}
|
||||
{{- if not $title }}
|
||||
{{- $title = $to.Site.Title }}
|
||||
{{- end }}
|
||||
{{- $url := partial "relLangPrettyUglyURL.hugo" (dict "to" $to) }}
|
||||
{{- $last := eq $url $pageurl }}
|
||||
{{- $link := and $url (not $last) }}
|
||||
{{- 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 " %s " (default ">" .Site.Params.breadcrumbSeparator)) | safeHTML }}{{ end }}</li>
|
||||
{{- end }}
|
||||
{{- end }}
|
|
@ -30,7 +30,7 @@
|
|||
</div>
|
||||
<div id="content-wrapper" class="highlightable">
|
||||
<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" }}
|
||||
{{- $currentOrdersectionsby := .Site.Home.Params.ordersectionsby | default $defaultOrdersectionsby }}
|
||||
{{- $defaultAlwaysopen := .Site.Params.alwaysopen | default false }}
|
||||
|
@ -166,14 +166,17 @@
|
|||
{{- end }}
|
||||
{{- safeHTML .Params.head }}
|
||||
{{- if $numberOfVisibleChildren }}
|
||||
{{- $title := or .Params.menuTitle .LinkTitle .Title }}
|
||||
{{- $url := partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}
|
||||
{{- $defaultOrdersectionsby := .Site.Params.ordersectionsby | default "weight" }}
|
||||
{{- $currentOrdersectionsby := .Params.ordersectionsby | default $defaultOrdersectionsby }}
|
||||
{{- $isCollapsible := or (.Params.collapsibleMenu | default .Site.Params.collapsibleMenu) (not $url) }}
|
||||
{{- $currentAlwaysopen := .Params.alwaysopen | default $alwaysopen }}
|
||||
{{- $pageHash := md5 .Page }}
|
||||
{{- $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" .) }}">
|
||||
{{- partial "menu-pre.html" . }}{{ or .Params.menuTitle .LinkTitle .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 }}">
|
||||
<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" . }}{{ $title }}{{ partial "menu-post.html" . }}
|
||||
{{- 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 }}
|
||||
{{- if eq $currentOrdersectionsby "title" }}
|
||||
{{- range $pages.ByTitle }}
|
||||
|
@ -185,9 +188,11 @@
|
|||
{{- end }}
|
||||
{{- end }}</ul></li>
|
||||
{{- else }}
|
||||
<li data-nav-id="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}" class="{{if $isActive }}active{{end}}"><a class="padding" href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}">
|
||||
{{- partial "menu-pre.html" . }}{{ or .Params.menuTitle .LinkTitle .Title }}{{ partial "menu-post.html" . }}
|
||||
{{- if $showvisitedlinks }}<i class="fas fa-check read-icon"></i>{{ end }}</a></li>
|
||||
{{- $title := or .Params.menuTitle .LinkTitle .Title }}
|
||||
{{- $url := partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}
|
||||
<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 }}
|
||||
|
|
|
@ -1,7 +1,13 @@
|
|||
{{- $page := .page }}
|
||||
{{- $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 */}}
|
||||
{{- $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 }}
|
||||
{{- partial "output-partial.hugo" (dict "base" "article" "page" $page "parameter" (dict "page" $page "content" $content "outputFormat" $outputFormat) "outputFormat" $outputFormat) }}
|
||||
{{- $content := "" }}
|
||||
{{- $url := partial "relLangPrettyUglyURL.hugo" (dict "to" $page) }}
|
||||
{{- if $url }}
|
||||
{{- $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 */}}
|
||||
{{- $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 }}
|
|
@ -20,12 +20,12 @@
|
|||
{{- template "relearn-structure" dict "node" .Site.Home "currentnode" $currentNode "hiddenstem" false "hiddencurrent" false "defaultOrdersectionsby" (.Site.Params.ordersectionsby | default "weight") }}
|
||||
{{- define "relearn-structure" }}
|
||||
{{- $currentNode := .currentnode }}
|
||||
{{- $isSelf := eq $currentNode.RelPermalink .node.RelPermalink }}
|
||||
{{- $isSelf := eq $currentNode .node }}
|
||||
{{- $isDescendant := and (not $isSelf) (.node.IsDescendant $currentNode) }}
|
||||
{{- $isAncestor := and (not $isSelf) (.node.IsAncestor $currentNode) }}
|
||||
{{- $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 }}
|
||||
{{- $currentNode.Scratch.Set "relearnIsSelfFound" true }}
|
||||
{{- end}}
|
||||
|
@ -44,9 +44,9 @@
|
|||
{{- $currentNode.Scratch.SetInMap "relearnIsHiddenFrom" .node.RelPermalink $hidden_current_stem }}
|
||||
|
||||
{{- if not $hidden_from_current }}
|
||||
{{- if $isPreSelf }}
|
||||
{{- if and $isPreSelf .node.RelPermalink }}
|
||||
{{- $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 }}
|
||||
{{- end}}
|
||||
{{- end }}
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
{{- if hasPrefix $.style "h" }}
|
||||
{{- $num := sub ( int (trim $.style "h") ) 1 }}
|
||||
{{- $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 -}}
|
||||
<p>{{ .Description }}</p>
|
||||
|
@ -60,7 +60,7 @@
|
|||
{{- end }}
|
||||
|
||||
{{- 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 -}}
|
||||
<p>{{ .Description }}</p>
|
||||
|
@ -70,7 +70,7 @@
|
|||
{{- end }}
|
||||
|
||||
{{- 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 -}}
|
||||
<p>{{ .Description }}</p>
|
||||
|
|
|
@ -10,12 +10,8 @@
|
|||
{{- if eq (T "Reading-direction" | default "ltr") "rtl" }}
|
||||
{{- $endarrow = "🡐" }}
|
||||
{{- end }}
|
||||
{{- $ispublished := true }}
|
||||
{{- with .Parent }}
|
||||
{{- $ispublished = gt (int (len .Permalink)) 0 }}
|
||||
{{- end }}
|
||||
{{- $next := "" }}
|
||||
{{- if or (ne $outputFormat "html") (not (and $ispublished (.Scratch.Get "relearnNextPage"))) }}
|
||||
{{- if or (ne $outputFormat "html") (not (.Scratch.Get "relearnNextPage")) }}
|
||||
{{- else }}
|
||||
{{- $next = .Scratch.Get "relearnNextPage" }}
|
||||
{{- end }}
|
||||
|
|
|
@ -10,13 +10,9 @@
|
|||
{{- if eq (T "Reading-direction" | default "ltr") "rtl" }}
|
||||
{{- $startarrow = "🡒" }}
|
||||
{{- end }}
|
||||
{{- $ispublished := true }}
|
||||
{{- with .Parent }}
|
||||
{{- $ispublished = gt (int (len .Permalink)) 0 }}
|
||||
{{- end }}
|
||||
{{- $prev := "" }}
|
||||
{{- 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 }}
|
||||
{{- else }}
|
||||
{{- $prev = .Scratch.Get "relearnPrevPage" }}
|
||||
|
|
|
@ -106,6 +106,12 @@ body,
|
|||
margin-top: 1.5rem;
|
||||
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 .footline a,
|
||||
#body #body-inner .btn a {
|
||||
|
|
|
@ -270,7 +270,7 @@
|
|||
|
||||
#sidebar .collapsible-menu label,
|
||||
#sidebar .menu-control,
|
||||
#sidebar a {
|
||||
#sidebar :is( a, span ) {
|
||||
color: rgba( 186, 186, 186, 1 ); /* var(--MENU-SECTIONS-LINK-color) */
|
||||
}
|
||||
|
||||
|
|
|
@ -185,7 +185,7 @@ body #sidebar a:hover {
|
|||
}
|
||||
|
||||
body #sidebar li.active > label,
|
||||
body #sidebar li.active > a {
|
||||
body #sidebar li.active > :is( a, span ) {
|
||||
color: rgba( 255, 255, 255, 1 );
|
||||
text-shadow:
|
||||
0 0 1px rgba( 255, 255, 255, 1 ),
|
||||
|
|
|
@ -1856,7 +1856,7 @@ article ul > li > input[type="checkbox"]:checked::before {
|
|||
|
||||
/* basic menu list styles (non-collapsible) */
|
||||
|
||||
#sidebar ul > li > a {
|
||||
#sidebar ul > li > :is( a, span ) {
|
||||
display: block;
|
||||
position: relative;
|
||||
}
|
||||
|
@ -1879,7 +1879,7 @@ article ul > li > input[type="checkbox"]:checked::before {
|
|||
padding-top: 0;
|
||||
}
|
||||
|
||||
#sidebar ul.enlarge > li > a {
|
||||
#sidebar ul.enlarge > li > :is( a, span ) {
|
||||
font-size: 1.1rem;
|
||||
line-height: 2rem;
|
||||
}
|
||||
|
@ -1948,7 +1948,7 @@ article ul > li > input[type="checkbox"]:checked::before {
|
|||
width: .6rem;
|
||||
}
|
||||
|
||||
#sidebar ul.collapsible-menu > li > a {
|
||||
#sidebar ul.collapsible-menu > li > :is( a, span ) {
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ a:hover,
|
|||
|
||||
#sidebar .collapsible-menu label,
|
||||
#sidebar .menu-control,
|
||||
#sidebar a {
|
||||
#sidebar :is( a, span ) {
|
||||
color: var(--INTERNAL-MENU-SECTIONS-LINK-color);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue