diff options
author | Dominik Juelg <djuelg@gmx.de> | 2016-10-22 18:20:33 +0300 |
---|---|---|
committer | Dominik Juelg <djuelg@gmx.de> | 2016-10-22 18:20:47 +0300 |
commit | 9a465d00c291a602dbd53297774c26e0f6f95147 (patch) | |
tree | 44474dac87382ea712c6d0468355ef466494eab0 | |
parent | af11f1a9a9dd307c07ee757db6321b03b91f22d1 (diff) |
Added Front-Matter dynamically into <head> for SEO
-rw-r--r-- | layouts/partials/head.html | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html index acfb606..497d805 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -1,10 +1,16 @@ +{{ .Hugo.Generator }} <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> + +<title>{{ $isHomePage := eq .Title .Site.Title }}{{ .Title }} - {{ if eq $isHomePage false }}{{ delimit .Keywords ", " }} - {{ .Site.Title }}{{ else }}{{ delimit .Site.Params.keywords ", " }}{{ end }}</title> <meta name="author" content="{{ with .Site.Params.name }}{{ . }}{{ end }}"> -<meta name="description" content="{{ with .Site.Params.description }}{{ . }}{{ end }}"> -{{ .Hugo.Generator }} -<title>{{ .Site.Title }}</title> +<meta name="description" content="{{ $isHomePage := eq .Title .Site.Title }}{{ if eq $isHomePage false }}{{ .Description }} - {{ end }}{{ .Site.Params.description }}"> +<meta name="keywords" content="{{ delimit .Keywords ", " }}"> + +<meta property="og:title" content="{{ $isHomePage := eq .Title .Site.Title }}{{ .Title }} - {{ if eq $isHomePage false }}{{ delimit .Keywords ", " }} - {{ .Site.Title }}{{ else }}{{ delimit .Site.Params.keywords ", " }}{{ end }}"> +<meta property="og:description" content="{{ $isHomePage := eq .Title .Site.Title }}{{ if eq $isHomePage false }}{{ .Description }} - {{ end }}{{ .Site.Params.description }}"> + {{ "<!-- Site Icon -->" | safeHTML }} <link rel="shortcut icon" href="{{ .Site.BaseURL }}{{ .Site.Params.logo }}"> {{ "<!-- Load CSS config -->" | safeHTML }} |