Skip to content

Commit

Permalink
Merge pull request matcornic#184 from cloudreach/willwade-master
Browse files Browse the repository at this point in the history
RETRY - Params to turn off next/previous page - and breadcrumb
  • Loading branch information
matalo33 authored Nov 1, 2018
2 parents 631c91a + f827844 commit 40e9fea
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
4 changes: 2 additions & 2 deletions exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
4 changes: 4 additions & 0 deletions exampleSite/content/basics/configuration/_index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -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".
Expand Down
15 changes: 9 additions & 6 deletions layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
7 changes: 6 additions & 1 deletion layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down

0 comments on commit 40e9fea

Please sign in to comment.