From 344b004dd94c60df35663de8c75ae0697b3d95db Mon Sep 17 00:00:00 2001 From: Serghei Iakovlev Date: Sun, 22 May 2022 21:30:45 +0200 Subject: Rework setting title logic --- layouts/partials/head.html | 2 +- layouts/partials/title.html | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 layouts/partials/title.html (limited to 'layouts/partials') diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 44bc202..3ef34e2 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -5,7 +5,7 @@ - {{ block "title" . }}{{ if .IsHome }}{{ site.Title }}{{ else }}{{ with .Params.Title }}{{ . }} - {{ end }}{{ site.Title }}{{ end }}{{ end }} + {{ block "title" . }}{{- partial "title.html" . -}}{{ end }} {{ hugo.Generator }} diff --git a/layouts/partials/title.html b/layouts/partials/title.html new file mode 100644 index 0000000..a767901 --- /dev/null +++ b/layouts/partials/title.html @@ -0,0 +1,5 @@ +{{- if .IsHome -}} + {{- site.Title -}} +{{- else -}} + {{- with .Title }}{{ . }} - {{ end }}{{ site.Title -}} +{{- end -}} -- cgit v1.2.3