mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-01-18 19:00:24 +00:00
print: enable print for pages with _build options #522
This commit is contained in:
parent
754b5c85ab
commit
f38878f664
11 changed files with 41 additions and 60 deletions
|
@ -100,7 +100,7 @@ disableHugoGeneratorInject = true
|
||||||
|
|
||||||
[[languages.en.menu.shortcuts]]
|
[[languages.en.menu.shortcuts]]
|
||||||
name = "<i class='fas fa-fw fa-camera'></i> Showcases"
|
name = "<i class='fas fa-fw fa-camera'></i> Showcases"
|
||||||
url = "more/showcase/"
|
url = "showcase/"
|
||||||
weight = 11
|
weight = 11
|
||||||
|
|
||||||
[[languages.en.menu.shortcuts]]
|
[[languages.en.menu.shortcuts]]
|
||||||
|
@ -140,7 +140,7 @@ disableHugoGeneratorInject = true
|
||||||
|
|
||||||
[[languages.pir.menu.shortcuts]]
|
[[languages.pir.menu.shortcuts]]
|
||||||
name = "<i class='fas fa-fw fa-camera'></i> Showcases"
|
name = "<i class='fas fa-fw fa-camera'></i> Showcases"
|
||||||
url = "more/showcase/"
|
url = "showcase/"
|
||||||
weight = 11
|
weight = 11
|
||||||
|
|
||||||
[[languages.pir.menu.shortcuts]]
|
[[languages.pir.menu.shortcuts]]
|
||||||
|
|
|
@ -20,7 +20,7 @@ weight = 10
|
||||||
|
|
||||||
[[menu.shortcuts]]
|
[[menu.shortcuts]]
|
||||||
name = "<i class='fas fa-fw fa-camera'></i> Showcases"
|
name = "<i class='fas fa-fw fa-camera'></i> Showcases"
|
||||||
url = "more/showcase/"
|
url = "showcase/"
|
||||||
weight = 11
|
weight = 11
|
||||||
|
|
||||||
[[menu.shortcuts]]
|
[[menu.shortcuts]]
|
||||||
|
@ -75,7 +75,7 @@ Example from the current website:
|
||||||
|
|
||||||
[[languages.en.menu.shortcuts]]
|
[[languages.en.menu.shortcuts]]
|
||||||
name = "<i class='fas fa-fw fa-camera'></i> Showcases"
|
name = "<i class='fas fa-fw fa-camera'></i> Showcases"
|
||||||
url = "more/showcase/"
|
url = "showcase/"
|
||||||
weight = 11
|
weight = 11
|
||||||
|
|
||||||
[[languages.en.menu.shortcuts]]
|
[[languages.en.menu.shortcuts]]
|
||||||
|
@ -109,7 +109,7 @@ Example from the current website:
|
||||||
|
|
||||||
[[languages.pir.menu.shortcuts]]
|
[[languages.pir.menu.shortcuts]]
|
||||||
name = "<i class='fas fa-fw fa-camera'></i> Showcases"
|
name = "<i class='fas fa-fw fa-camera'></i> Showcases"
|
||||||
url = "more/showcase/"
|
url = "showcase/"
|
||||||
weight = 11
|
weight = 11
|
||||||
|
|
||||||
[[languages.pir.menu.shortcuts]]
|
[[languages.pir.menu.shortcuts]]
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
+++
|
+++
|
||||||
disableToc = true
|
|
||||||
title = "Credits"
|
title = "Credits"
|
||||||
+++
|
+++
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
+++
|
+++
|
||||||
disableToc = true
|
|
||||||
title = "Crrredits"
|
title = "Crrredits"
|
||||||
+++
|
+++
|
||||||
{{< piratify >}}
|
{{< piratify >}}
|
|
@ -1,4 +0,0 @@
|
||||||
+++
|
|
||||||
title = "Showcase"
|
|
||||||
+++
|
|
||||||
{{< piratify >}}
|
|
|
@ -1,5 +1,9 @@
|
||||||
+++
|
+++
|
||||||
title = "Showcase"
|
title = "Showcase"
|
||||||
|
[_build]
|
||||||
|
render = "always"
|
||||||
|
list = "never"
|
||||||
|
publishResources = true
|
||||||
+++
|
+++
|
||||||
|
|
||||||
## [GoboLinux Wiki](https://wiki.gobolinux.org/) by NEONsys.org
|
## [GoboLinux Wiki](https://wiki.gobolinux.org/) by NEONsys.org
|
||||||
|
@ -10,6 +14,6 @@ title = "Showcase"
|
||||||
|
|
||||||
![BITS image](bits-train.png?width=60pc&classes=shadow)
|
![BITS image](bits-train.png?width=60pc&classes=shadow)
|
||||||
|
|
||||||
## [Pamasol Electrics](https://pamasol.github.io/de/) by Pamasol – Swiss Aerosol Solutions
|
## [Pamasol Electrics](https://pamasol.github.io/de/) by Pamasol
|
||||||
|
|
||||||
![Pamasol Electrics](pamasol-electrics-portal.png?width=60pc&classes=shadow)
|
![Pamasol Electrics](pamasol-electrics-portal.png?width=60pc&classes=shadow)
|
8
exampleSite/content/showcase/_index.pir.md
Normal file
8
exampleSite/content/showcase/_index.pir.md
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
+++
|
||||||
|
title = "Showcase"
|
||||||
|
[_build]
|
||||||
|
render = "always"
|
||||||
|
list = "never"
|
||||||
|
publishResources = true
|
||||||
|
+++
|
||||||
|
{{< piratify >}}
|
Before Width: | Height: | Size: 128 KiB After Width: | Height: | Size: 128 KiB |
Before Width: | Height: | Size: 240 KiB After Width: | Height: | Size: 240 KiB |
Before Width: | Height: | Size: 156 KiB After Width: | Height: | Size: 156 KiB |
|
@ -3,55 +3,34 @@
|
||||||
{{- $page.Page.Store.Set (printf "%sIsNested" $outputFormat) true }}
|
{{- $page.Page.Store.Set (printf "%sIsNested" $outputFormat) true }}
|
||||||
{{- with $page }}
|
{{- with $page }}
|
||||||
{{- $currentNode := . }}
|
{{- $currentNode := . }}
|
||||||
{{- $isActive := .IsHome }}
|
{{- $pages := .Pages }}
|
||||||
{{- $isShortcut := false }}
|
{{- $defaultOrdersectionsby := .Site.Params.ordersectionsby | default "weight" }}
|
||||||
{{- with .Site.Menus.shortcuts }}
|
{{- $currentOrdersectionsby := .Params.ordersectionsby | default $defaultOrdersectionsby }}
|
||||||
{{- range sort . "Weight" }}
|
{{- template "section-print" dict "sect" . "currentnode" $currentNode "outputFormat" $outputFormat }}
|
||||||
{{- $shortcut := . }}
|
{{- if $pages }}
|
||||||
{{- $shortcutPage := $page.Site.GetPage (printf "%s" $shortcut.URL ) }}
|
<section>
|
||||||
{{- if and $shortcutPage (eq $shortcutPage.RelPermalink $page.RelPermalink) }}
|
<h1 class="a11y-only">{{ T "Subsections" .Title }}</h1>
|
||||||
{{- $isShortcut = true }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- if eq $currentOrdersectionsby "title" }}
|
||||||
|
{{- range $pages.ByTitle }}
|
||||||
|
{{- template "section-tree-print" dict "sect" . "currentnode" $currentNode "outputFormat" $outputFormat }}
|
||||||
|
{{- end }}
|
||||||
|
{{- else }}
|
||||||
|
{{- range $pages.ByWeight }}
|
||||||
|
{{- template "section-tree-print" dict "sect" . "currentnode" $currentNode "outputFormat" $outputFormat }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- $pages := .Site.Home.Pages }}
|
{{- if $pages }}
|
||||||
{{- $defaultOrdersectionsby := .Site.Params.ordersectionsby | default "weight" }}
|
</section>
|
||||||
{{- $currentOrdersectionsby := .Site.Home.Params.ordersectionsby | default $defaultOrdersectionsby }}
|
|
||||||
{{- if $isShortcut }}
|
|
||||||
{{- template "section-print" dict "sect" . "currentnode" $currentNode "outputFormat" $outputFormat }}
|
|
||||||
{{- else }}
|
|
||||||
{{- if $isActive }}
|
|
||||||
{{- template "section-print" dict "sect" . "currentnode" $currentNode "outputFormat" $outputFormat }}
|
|
||||||
{{- if $pages }}
|
|
||||||
<section>
|
|
||||||
<h1 class="a11y-only">{{ T "Subsections" .Title }}</h1>
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
{{- if eq $currentOrdersectionsby "title" }}
|
|
||||||
{{- range $pages.ByTitle }}
|
|
||||||
{{- template "section-tree-print" dict "sect" . "currentnode" $currentNode "outputFormat" $outputFormat "isActive" $isActive }}
|
|
||||||
{{- end }}
|
|
||||||
{{- else }}
|
|
||||||
{{- range $pages.ByWeight }}
|
|
||||||
{{- template "section-tree-print" dict "sect" . "currentnode" $currentNode "outputFormat" $outputFormat "isActive" $isActive }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
{{- if $isActive }}
|
|
||||||
{{- if $pages }}
|
|
||||||
</section>
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- define "section-tree-print" }}
|
{{- define "section-tree-print" }}
|
||||||
{{- $currentNode := .currentnode }}
|
{{- $currentNode := .currentnode }}
|
||||||
{{- $outputFormat := .outputFormat }}
|
{{- $outputFormat := .outputFormat }}
|
||||||
{{- $isActive := .isActive }}
|
|
||||||
{{- $currentFileRelPermalink := .currentnode.RelPermalink }}
|
{{- $currentFileRelPermalink := .currentnode.RelPermalink }}
|
||||||
{{- with .sect }}
|
{{- with .sect }}
|
||||||
{{- $isSelf := eq .RelPermalink $currentFileRelPermalink }}
|
{{- $isSelf := eq .RelPermalink $currentFileRelPermalink }}
|
||||||
{{- $isAncestor := and (not $isSelf) (.IsAncestor $currentNode) }}
|
{{- $isAncestor := and (not $isSelf) (.IsAncestor $currentNode) }}
|
||||||
{{- $isActive = or $isSelf $isActive }}
|
|
||||||
{{- $pages := .Pages }}
|
{{- $pages := .Pages }}
|
||||||
{{- $relearnIsHiddenFrom := index ($currentNode.Scratch.Get "relearnIsHiddenFrom") .RelPermalink }}
|
{{- $relearnIsHiddenFrom := index ($currentNode.Scratch.Get "relearnIsHiddenFrom") .RelPermalink }}
|
||||||
{{- $hidden := and $relearnIsHiddenFrom (not $.showhidden) (not $isSelf) (not $isAncestor) }}
|
{{- $hidden := and $relearnIsHiddenFrom (not $.showhidden) (not $isSelf) (not $isAncestor) }}
|
||||||
|
@ -59,26 +38,22 @@
|
||||||
{{- else }}
|
{{- else }}
|
||||||
{{- $defaultOrdersectionsby := .Site.Params.ordersectionsby | default "weight" }}
|
{{- $defaultOrdersectionsby := .Site.Params.ordersectionsby | default "weight" }}
|
||||||
{{- $currentOrdersectionsby := .Params.ordersectionsby | default $defaultOrdersectionsby }}
|
{{- $currentOrdersectionsby := .Params.ordersectionsby | default $defaultOrdersectionsby }}
|
||||||
{{- if $isActive }}
|
{{- template "section-print" dict "sect" . "currentnode" $currentNode "outputFormat" $outputFormat }}
|
||||||
{{- template "section-print" dict "sect" . "currentnode" $currentNode "outputFormat" $outputFormat }}
|
{{- if $pages }}
|
||||||
{{- if $pages }}
|
|
||||||
<section>
|
<section>
|
||||||
<h1 class="a11y-only">{{ T "Subsections" .Title }}</h1>
|
<h1 class="a11y-only">{{ T "Subsections" .Title }}</h1>
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if eq $currentOrdersectionsby "title" }}
|
{{- if eq $currentOrdersectionsby "title" }}
|
||||||
{{- range $pages.ByTitle }}
|
{{- range $pages.ByTitle }}
|
||||||
{{- template "section-tree-print" dict "sect" . "currentnode" $currentNode "outputFormat" $outputFormat "isActive" $isActive }}
|
{{- template "section-tree-print" dict "sect" . "currentnode" $currentNode "outputFormat" $outputFormat }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- else }}
|
{{- else }}
|
||||||
{{- range $pages.ByWeight }}
|
{{- range $pages.ByWeight }}
|
||||||
{{- template "section-tree-print" dict "sect" . "currentnode" $currentNode "outputFormat" $outputFormat "isActive" $isActive }}
|
{{- template "section-tree-print" dict "sect" . "currentnode" $currentNode "outputFormat" $outputFormat }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if $isActive }}
|
{{- if $pages }}
|
||||||
{{- if $pages }}
|
|
||||||
</section>
|
</section>
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -93,4 +68,4 @@
|
||||||
{{- $currentNode.Page.Store.Set "nestedHasMermaid" (or ($currentNode.Page.Store.Get "nestedHasMermaid") (.Page.Store.Get "hasMermaid")) }}
|
{{- $currentNode.Page.Store.Set "nestedHasMermaid" (or ($currentNode.Page.Store.Get "nestedHasMermaid") (.Page.Store.Get "hasMermaid")) }}
|
||||||
{{- $currentNode.Page.Store.Set "nestedHasOpenapi" (or ($currentNode.Page.Store.Get "nestedHasOpenapi") (.Page.Store.Get "hasOpenapi")) }}
|
{{- $currentNode.Page.Store.Set "nestedHasOpenapi" (or ($currentNode.Page.Store.Get "nestedHasOpenapi") (.Page.Store.Get "hasOpenapi")) }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
Loading…
Reference in a new issue