diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 1356cf7c..14f44f21 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -104,6 +104,11 @@ canonifyurls = true # Default format is: January 2, 2006 # dateFormat = "2 January 2006" + # Customize title format + # This parameter affect to pages except home page + # If empty it will be title only + # titleFormat = "$pageTitle - $siteTitle" + # Global keywords configuration. Following keywords will be add to every pages # keywords = ["development", "next-gen"] diff --git a/layouts/partials/head.html b/layouts/partials/head.html index fabc8fcf..90de4304 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -26,7 +26,7 @@ {{ partial "head_start.html" . }} {{ partial "meta.html" . }} - {{ with .Title }}{{ . }}{{ else }}{{ .Site.Title }}{{ end }} + {{ if and (ne .Kind "home") .Title .Site.Params.titleFormat }}{{ replace (replace .Site.Params.titleFormat "$pageTitle" .Title) "$siteTitle" .Site.Title }}{{ else if .Title }}{{ .Title }}{{ else }}{{ .Site.Title }}{{ end }} {{ with .RSSLink }}