From 12df32764f174cdcdaccfdbf00fac393d038ef05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Thu, 24 Feb 2022 23:09:49 +0100 Subject: [PATCH] theme: adjust breadcrumb and title for empty home page titles #202 --- exampleSite/content/cont/menushortcuts.en.md | 4 ++-- exampleSite/layouts/shortcodes/piratify.html | 1 - layouts/partials/header.html | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/exampleSite/content/cont/menushortcuts.en.md b/exampleSite/content/cont/menushortcuts.en.md index 8c8aaa374b4..1fc75f9ce9c 100644 --- a/exampleSite/content/cont/menushortcuts.en.md +++ b/exampleSite/content/cont/menushortcuts.en.md @@ -61,7 +61,7 @@ Example from the current website: ````toml [Languages] [Languages.en] - title = "Documentation for Hugo Relearn Theme" + title = "Hugo Relearn Theme" weight = 1 languageName = "English" landingPageURL = "/" @@ -95,7 +95,7 @@ Example from the current website: weight = 40 [Languages.pir] - title = "Documentat'n fer Cap'n Hugo Relearrrn Theme" + title = "Cap'n Hugo Relearrrn Theme" weight = 1 languageName = "Arrr! Pirrrates" landingPageURL = "/pir/" diff --git a/exampleSite/layouts/shortcodes/piratify.html b/exampleSite/layouts/shortcodes/piratify.html index bd4b625cc54..c9c14c81906 100644 --- a/exampleSite/layouts/shortcodes/piratify.html +++ b/exampleSite/layouts/shortcodes/piratify.html @@ -78,7 +78,6 @@ "warn'n" "warning" "sect'n" "section" "n Cap'n" "n" - "Documentat'n fer Cap'n Hugo Relearrrn Theme" "Documentation for Hugo Relearn Theme" "Avast right o' John" "Note right of John" -}} {{- $c := "" }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 8a68a703195..1b98ed11639 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -2,7 +2,7 @@ {{- partial "meta.html" . }} - {{ .Title }} {{ default "::" .Site.Params.titleSeparator }} {{ .Site.Title }} + {{ if and .Title (not (eq .Title .Site.Title)) }}{{ .Title }} {{ default "::" .Site.Params.titleSeparator }} {{ end}}{{ .Site.Title }} {{- if not (and .Title (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSeoHiddenPages true) ) ) }} {{- else }} @@ -120,6 +120,6 @@

{{ if eq .Kind "term" }}{{ .Data.Singular | humanize }} {{ default "::" .Sit {{- template "breadcrumb" dict "page" $parent "depth" $depth }} {{- end }} {{- if $ispublished }} -
  • {{ .page.Title }}{{ if .depth }} > {{ end }}
  • +
  • {{if .page.Title}}{{ .page.Title }}{{else}}{{ .page.Site.Title }}{{end}}{{ if .depth }} > {{ end }}
  • {{- end }} {{- end }} \ No newline at end of file