Skip to content

Commit

Permalink
Added Front-Matter dynamically into <head> for SEO
Browse files Browse the repository at this point in the history
  • Loading branch information
djuelg committed Oct 22, 2016
1 parent af11f1a commit 9a465d0
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
@@ -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 }}
Expand Down

0 comments on commit 9a465d0

Please sign in to comment.