mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 01:33:04 +00:00
Merge branch 'helfper-menu-pre-post-template' into 2.0.0
This commit is contained in:
commit
5bd4856426
7 changed files with 8 additions and 8 deletions
|
@ -1,8 +1,7 @@
|
|||
+++
|
||||
chapter = true
|
||||
pre = "<b>1. </b>"
|
||||
title = "Basics"
|
||||
weight = 5
|
||||
weight = 1
|
||||
+++
|
||||
|
||||
### Chapter 1
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
+++
|
||||
chapter = true
|
||||
pre = "<b>2. </b>"
|
||||
title = "Content"
|
||||
weight = 10
|
||||
weight = 2
|
||||
+++
|
||||
|
||||
### Chapter 2
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
+++
|
||||
chapter = true
|
||||
pre = "<b>3. </b>"
|
||||
title = "Shortcodes"
|
||||
weight = 15
|
||||
weight = 3
|
||||
+++
|
||||
|
||||
### Chapter 3
|
||||
|
|
1
exampleSite/layouts/partials/menu-pre.html
Normal file
1
exampleSite/layouts/partials/menu-pre.html
Normal file
|
@ -0,0 +1 @@
|
|||
{{ if .Params.chapter }}<b>{{ .Params.weight }}. </b>{{ end }}
|
1
layouts/partials/menu-post.html
Normal file
1
layouts/partials/menu-post.html
Normal file
|
@ -0,0 +1 @@
|
|||
{{ .Params.Post | safeHTML }}
|
1
layouts/partials/menu-pre.html
Normal file
1
layouts/partials/menu-pre.html
Normal file
|
@ -0,0 +1 @@
|
|||
{{ .Params.Pre | safeHTML }}
|
|
@ -110,7 +110,7 @@
|
|||
{{ $currentAlwaysopen := .Params.alwaysopen | default $alwaysopen }}
|
||||
<li data-nav-id="{{.RelPermalink}}" title="{{.Title}}" class="dd-item{{if eq .File.UniqueID $currentFileUniqueID}} active{{else if .IsAncestor $currentNode }} parent{{else if $currentAlwaysopen}} parent{{end}}">
|
||||
<a href="{{.RelPermalink}}">
|
||||
{{safeHTML .Params.Pre}}{{or .Params.menuTitle .LinkTitle .Title}}{{safeHTML .Params.Post}}
|
||||
{{ 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>
|
||||
{{ $numberOfPages := (add (len ( where .Pages "Params.hidden" "ne" true )) (len ( where .Sections "Params.hidden" "ne" true ))) }}
|
||||
|
@ -143,7 +143,7 @@
|
|||
{{else if not .Params.Hidden }}
|
||||
<li data-nav-id="{{.RelPermalink}}" title="{{.Title}}" class="dd-item{{if eq .File.UniqueID $currentFileUniqueID}} active{{end}}">
|
||||
<a href="{{ .RelPermalink}}">
|
||||
{{safeHTML .Params.Pre}}{{or .Params.menuTitle .LinkTitle .Title}}{{safeHTML .Params.Post}}
|
||||
{{ 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>
|
||||
|
|
Loading…
Reference in a new issue