Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/escalate/hugo-split-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Boerner <ich@felix-boerner.de>2018-05-25 20:19:35 +0300
committerFelix Boerner <ich@felix-boerner.de>2018-05-25 20:19:35 +0300
commite7b2132fe17c937ebcb7ee2394cf66ce7726887e (patch)
tree6e313bdcf618e57b806f355dab554217b3e736d4
parent9b3f131a8de82125f6f577fb40e7df4443dcabcf (diff)
feat: change title behaviour
Use site title only if it's the homepage Use page title with site title together if it's a regular page
-rw-r--r--layouts/partials/head.html4
1 files changed, 2 insertions, 2 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index d35f20f..3782f6a 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -2,14 +2,14 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!-- SEO -->
-<title>{{ .Title }}</title>
+<title>{{ if .IsPage }}{{ .Title }} - {{ end }}{{ .Site.Title }}</title>
{{ with .Site.Params.author }}<meta name="author" content="{{ . }}" />{{ end }}
{{ with .Site.Params.description }}<meta name="description" content="{{ . }}" />{{ end }}
<meta name="robots" content="index, follow" />
<meta name="referrer" content="always" />
<!-- Social & Open Graph -->
-<meta property="og:title" content="{{ .Title }}" />
+<meta property="og:title" content="{{ if .IsPage }}{{ .Title }} - {{ end }}{{ .Site.Title }}" />
{{ with .Site.Params.description }}<meta property="og:description" content="{{ . }}" />{{ end }}
<meta property="og:url" content="{{ .Site.BaseURL }}" />
{{ with .Site.Params.shareImage }}