diff --git a/layouts/partials/head.html b/layouts/partials/head.html index a117acc..cf1d71e 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -1,27 +1,25 @@ + {{- $defaultTitle := ( printf "%s - %s" .Site.Title .Site.Params.longTitle ) }} + {{- $title := .Title | default $defaultTitle }} + {{- $description := .Page.Description }} + {{- $keywords := .Page.Keywords }} + {{- $author := index $.Site.Data.authors (.Page.Params.Author | default .Site.Params.author) }} {{- if .IsHome }} - {{- $author := index $.Site.Data.authors .Site.Params.author }} - {{- with .Site.Params.description }} + {{ $title = $defaultTitle }} + {{ $description = .Site.Params.description }} + {{ $keywords = .Site.Params.keywords }} + {{- end }} + {{- with $description }} {{- end }} - {{- with .Site.Params.keywords }} + {{- with $keywords }} {{- end }} - - {{- else if in .Page.URL "/posts/" }} - {{- with .Page.Description }} - - {{- end }} - {{- with .Page.Keywords }} - - {{- end }} - {{- with .Page.Params.Author }} - {{- $author := index $.Site.Data.authors . }} + {{- with $author }} {{- end }} - {{- end }} - {{ .Site.Title }} - {{ .Site.Params.longTitle }} + {{ $title }}