diff options
| author | Serghei Iakovlev <egrep@protonmail.ch> | 2022-05-22 21:30:45 +0200 |
|---|---|---|
| committer | Serghei Iakovlev <egrep@protonmail.ch> | 2022-05-22 21:30:45 +0200 |
| commit | 344b004dd94c60df35663de8c75ae0697b3d95db (patch) | |
| tree | 9868acf9e27aa1aeab37583a997cf03ef8a95f14 /layouts/partials | |
| parent | 4f3e41d2c9d78ebbab00cbba76fa3889420bb0aa (diff) | |
| download | gohugo-theme-ed-344b004dd94c60df35663de8c75ae0697b3d95db.tar.gz | |
Rework setting title logic
Diffstat (limited to 'layouts/partials')
| -rw-r--r-- | layouts/partials/head.html | 2 | ||||
| -rw-r--r-- | layouts/partials/title.html | 5 |
2 files changed, 6 insertions, 1 deletions
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 @@ <link rel="canonical" href="{{ .Permalink }}"> - <title>{{ block "title" . }}{{ if .IsHome }}{{ site.Title }}{{ else }}{{ with .Params.Title }}{{ . }} - {{ end }}{{ site.Title }}{{ end }}{{ end }}</title> + <title>{{ block "title" . }}{{- partial "title.html" . -}}{{ end }}</title> <meta name="description" content="{{ (partial "description.html" . ) }}"> <meta name="author" content="{{ (partial "author.html" . ) }}"> {{ 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 -}} |
