feat: allow hiding breadcrumb on docs pages

By adding following to Hugo config or page frontmatter: `show_breadcrumb: false`

Close #3178
This commit is contained in:
George Cushen 2025-02-12 21:14:32 +00:00
commit 5c58e935f1
2 changed files with 3 additions and 1 deletions

View file

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

View file

@ -3,9 +3,11 @@
{{ partial "components/toc.html" . }}
<article class="flex w-full min-w-0 min-h-[calc(100vh-var(--navbar-height))] justify-center break-words pb-8 pr-[calc(env(safe-area-inset-right)-1.5rem)]">
<main class="prose prose-slate lg:prose-xl dark:prose-invert w-full min-w-0 max-w-6xl px-6 pt-4 md:px-12">
{{ if (.Params.show_breadcrumb | default true) }}
<div class="mb-1">
{{ partial "components/breadcrumb.html" . }}
</div>
{{ end }}
<div class="content text-base">
<h1>{{ .Title }}</h1>