From 2fd986166e139a7795d49535c5276c0fe633dbe9 Mon Sep 17 00:00:00 2001 From: will wade Date: Wed, 14 Mar 2018 00:28:37 +0000 Subject: [PATCH 1/5] adding .Site.Params.disableBreadcrumb NB: Still shows heading of page. Otherwise looks a bit ugly --- layouts/partials/header.html | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/layouts/partials/header.html b/layouts/partials/header.html index de16c932e8..503e196d1a 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -62,11 +62,15 @@ - {{ if $toc }} - - {{ end }} + {{ if $toc }} + + {{ end }} - {{ template "breadcrumb" dict "page" . "value" .Title }} + {{if ne .Site.Params.disableBreadcrumb true}} + {{ template "breadcrumb" dict "page" . "value" .Title }} + {{ else }} + {{ .Title }} + {{ end }} {{ if $toc }} From 6d6fde35b9530f0692751faf72e81fd648f141c4 Mon Sep 17 00:00:00 2001 From: will wade Date: Wed, 14 Mar 2018 00:30:00 +0000 Subject: [PATCH 2/5] adding .Site.Params.disableNextPrev adding this site param to disable back and forth.. --- layouts/partials/footer.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 4fd380dcf0..06b2d331ec 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -39,13 +39,14 @@ {{ end }} {{ end }} - + {{if ne .Site.Params.disableNextPrev true }} {{with ($.Scratch.Get "prevPage")}} {{end}} {{with ($.Scratch.Get "nextPage")}} {{end}} + {{end}} From a29add8d5e454ef14db604cff9a8adedece99926 Mon Sep 17 00:00:00 2001 From: willwade Date: Mon, 19 Mar 2018 10:40:10 +0000 Subject: [PATCH 3/5] changes so can now use page params as well as site --- layouts/partials/footer.html | 18 ++++++++++-------- layouts/partials/header.html | 3 ++- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 06b2d331ec..920c2718aa 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -39,14 +39,16 @@ {{ end }} {{ end }} - {{if ne .Site.Params.disableNextPrev true }} - {{with ($.Scratch.Get "prevPage")}} - - {{end}} - {{with ($.Scratch.Get "nextPage")}} - - {{end}} - {{end}} + + {{$showPrevNext := (and (not .Params.disableNextPrev) (not .Site.Params.disableNextPrev))}} + {{if $showPrevNext}} + {{with ($.Scratch.Get "prevPage")}} + + {{end}} + {{with ($.Scratch.Get "nextPage")}} + + {{end}} + {{end}} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 503e196d1a..a49852014a 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -66,7 +66,8 @@ {{ end }} - {{if ne .Site.Params.disableBreadcrumb true}} + {{$showBreadcrumb := (and (not .Params.disableBreadcrumb) (not .Site.Params.disableBreadcrumb))}} + {{if $showBreadcrumb}} {{ template "breadcrumb" dict "page" . "value" .Title }} {{ else }} {{ .Title }} From 53c67f15c6b4f21fe43526527d3dfed52b46968d Mon Sep 17 00:00:00 2001 From: Matthew Taylor Date: Mon, 22 Oct 2018 22:53:45 -0400 Subject: [PATCH 4/5] Enable breadcrumb and prevnext for demosite --- exampleSite/config.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 99ec511342..fe47a62d2d 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -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"] From 64fc30ecdefee45d8fe79d9a7929b25706d72286 Mon Sep 17 00:00:00 2001 From: Matthew Taylor Date: Mon, 22 Oct 2018 22:57:19 -0400 Subject: [PATCH 5/5] Add disableBreadcrumbs and disableNextPrev to English documentation --- exampleSite/content/basics/configuration/_index.en.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/exampleSite/content/basics/configuration/_index.en.md b/exampleSite/content/basics/configuration/_index.en.md index c0fbed8f7e..e56f84b75a 100644 --- a/exampleSite/content/basics/configuration/_index.en.md +++ b/exampleSite/content/basics/configuration/_index.en.md @@ -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".