From 5c58e935f1cdfbb904ad4eae3c51e1a6483a8f40 Mon Sep 17 00:00:00 2001 From: George Cushen Date: Wed, 12 Feb 2025 21:14:32 +0000 Subject: [PATCH] feat: allow hiding breadcrumb on docs pages By adding following to Hugo config or page frontmatter: `show_breadcrumb: false` Close #3178 --- modules/blox-tailwind/layouts/_default/home.backlinks.json | 2 +- modules/blox-tailwind/layouts/partials/docs_layout.html | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/blox-tailwind/layouts/_default/home.backlinks.json b/modules/blox-tailwind/layouts/_default/home.backlinks.json index 3d6d02c5..752a2289 100644 --- a/modules/blox-tailwind/layouts/_default/home.backlinks.json +++ b/modules/blox-tailwind/layouts/_default/home.backlinks.json @@ -1,6 +1,6 @@ {{- /* Hugo 0.126+ requires a `home` layout file even if it's empty, otherwise shows warning */ -}} +{{- range site.Pages -}}{{- $_ := .WordCount -}}{{- end -}} {{- if (eq (getenv "HUGO_BLOX_DEBUG") "true") -}} - {{- range site.Pages -}}{{- $_ := .WordCount -}}{{- end -}} {{- $backlinks := (.Store.Get "backlinks" | uniq) | default dict -}} {{- jsonify (dict "indent" " ") $backlinks -}} {{- else -}} diff --git a/modules/blox-tailwind/layouts/partials/docs_layout.html b/modules/blox-tailwind/layouts/partials/docs_layout.html index ca67dbfc..80c0031b 100644 --- a/modules/blox-tailwind/layouts/partials/docs_layout.html +++ b/modules/blox-tailwind/layouts/partials/docs_layout.html @@ -3,9 +3,11 @@ {{ partial "components/toc.html" . }}
+ {{ if (.Params.show_breadcrumb | default true) }}
{{ partial "components/breadcrumb.html" . }}
+ {{ end }}

{{ .Title }}