Merge pull request #184 from cloudreach/willwade-master

RETRY - Params to turn off next/previous page - and breadcrumb
This commit is contained in:
Matthew Taylor 2018-10-31 23:49:17 -04:00 committed by GitHub
commit 8726b9b02d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 9 deletions

View file

@ -13,8 +13,8 @@ defaultContentLanguageInSubdir= true
description = "Documentation for Hugo Learn Theme"
author = "Mathieu Cornic"
showVisitedLinks = true
disableBreadcrumb = true
disableNextPrev = true
disableBreadcrumb = false
disableNextPrev = false
[outputs]
home = [ "HTML", "RSS", "JSON"]

View file

@ -33,6 +33,10 @@ Note that some of these parameters are explained in details in other sections of
disableShortcutsTitle = false
# When using mulitlingual website, disable the switch language button.
disableLanguageSwitchingButton = false
# Hide breadcrumbs in the header and only show the current page title
disableBreadcrumb = true
# Hide Next and Previous page buttons normally displayed full height beside content
disableNextPrev = true
# Order sections in menu by "weight" or "title". Default to "weight"
ordersectionsby = "weight"
# Change default color scheme with a variant one. Can be "red", "blue", "green".

View file

@ -40,12 +40,15 @@
{{ end }}
{{with ($.Scratch.Get "prevPage")}}
<a class="nav nav-prev" href="{{.URL}}" title="{{.Title}}"> <i class="fas fa-chevron-left"></i></a>
{{end}}
{{with ($.Scratch.Get "nextPage")}}
<a class="nav nav-next" href="{{.URL}}" title="{{.Title}}" style="margin-right: 0px;"><i class="fas fa-chevron-right"></i></a>
{{end}}
{{$showPrevNext := (and (not .Params.disableNextPrev) (not .Site.Params.disableNextPrev))}}
{{if $showPrevNext}}
{{with ($.Scratch.Get "prevPage")}}
<a class="nav nav-prev" href="{{.URL}}" title="{{.Title}}"> <i class="fa fa-chevron-left"></i></a>
{{end}}
{{with ($.Scratch.Get "nextPage")}}
<a class="nav nav-next" href="{{.URL}}" title="{{.Title}}" style="margin-right: 0px;"><i class="fa fa-chevron-right"></i></a>
{{end}}
{{end}}
</div>
</section>

View file

@ -66,7 +66,12 @@
<span id="toc-menu"><i class="fas fa-list-alt"></i></span>
{{ end }}
<span class="links">
{{ template "breadcrumb" dict "page" . "value" .Title }}
{{$showBreadcrumb := (and (not .Params.disableBreadcrumb) (not .Site.Params.disableBreadcrumb))}}
{{if $showBreadcrumb}}
{{ template "breadcrumb" dict "page" . "value" .Title }}
{{ else }}
{{ .Title }}
{{ end }}
</span>
</div>
{{ if $toc }}