Merge branch 'helfper-menu-pre-post-template' into 2.0.0

This commit is contained in:
Sören Weber 2021-08-25 15:03:54 +02:00
commit 5bd4856426
No known key found for this signature in database
GPG key ID: 07D17FF580AE7589
7 changed files with 8 additions and 8 deletions

View file

@ -1,8 +1,7 @@
+++
chapter = true
pre = "<b>1. </b>"
title = "Basics"
weight = 5
weight = 1
+++
### Chapter 1

View file

@ -1,8 +1,7 @@
+++
chapter = true
pre = "<b>2. </b>"
title = "Content"
weight = 10
weight = 2
+++
### Chapter 2

View file

@ -1,8 +1,7 @@
+++
chapter = true
pre = "<b>3. </b>"
title = "Shortcodes"
weight = 15
weight = 3
+++
### Chapter 3

View file

@ -0,0 +1 @@
{{ if .Params.chapter }}<b>{{ .Params.weight }}. </b>{{ end }}

View file

@ -0,0 +1 @@
{{ .Params.Post | safeHTML }}

View file

@ -0,0 +1 @@
{{ .Params.Pre | safeHTML }}

View file

@ -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>