fix page title: avoid '-' if .Title is empty

This commit is contained in:
Helmut Merz 2022-02-14 14:32:24 +01:00
parent 983330c98c
commit edfaa990f1

View file

@ -7,7 +7,7 @@
{{ if .Site.Params.favicon -}}
<link rel="icon" href="{{ .Site.BaseURL }}img/{{ .Site.Params.favicon }}">
{{- end }}
{{ $title := or (i18n .Title) .Title -}}
{{ $title := or (i18n .Title) .Title .Site.Title -}}
<title>{{ $title }}{{ if ne $title .Site.Title }} - {{ .Site.Title }}{{ end }}</title>
{{ hugo.Generator }}
{{ $main := resources.Get "sass/main.scss" | toCSS | minify -}}