about summary refs log tree commit diff
path: root/layouts/partials/head.html
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/partials/head.html')
-rw-r--r--layouts/partials/head.html18
1 files changed, 17 insertions, 1 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 3857a99..cfacfb9 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -3,11 +3,27 @@
 {{ $custom := resources.Get "css/custom.css" }}
 {{ $style := slice $readable $theme $custom | resources.Concat "css/style.css" | minify | fingerprint }}
 
+{{ $fullTitle := .Title }}
+{{ with .Params.chapterName }}
+  {{ $fullTitle = printf "%s – %s" $fullTitle . }}
+{{ end }}
+
+{{ range .Ancestors }}
+{{ if in .Params.categories "book" }}
+  {{ $fullTitle = printf "%s, %s" .Title $fullTitle }}
+{{ end }}
+{{ end }}
+
 <meta charset="utf-8">
 <meta name="HandheldFriendly" content="True">
 <meta name="viewport" content="width=device-width, initial-scale=1.0">
 <meta name="referrer" content="no-referrer-when-downgrade">
 
-<title>{{ if and (.Title) (not .IsHome) }}{{ .Title }} - {{ end }}{{ .Site.Title }}</title>
+<title>
+	{{ if and (.Title) (not .IsHome) }}
+	{{ $fullTitle }} -
+	{{ end }}
+	{{ .Site.Title }}
+</title>
 <meta name="description" content="{{ .Site.Params.Description }}">
 <link rel="stylesheet" type="text/css" href="{{ $style.RelPermalink }}">