From 922e22cca55631437349fb186f62ff5ff2e41c24 Mon Sep 17 00:00:00 2001 From: George Cushen Date: Mon, 4 Oct 2021 12:59:57 +0100 Subject: [PATCH] feat: add support for page seo.title --- wowchemy/layouts/partials/site_head.html | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/wowchemy/layouts/partials/site_head.html b/wowchemy/layouts/partials/site_head.html index f8f0eb12..2c29e216 100644 --- a/wowchemy/layouts/partials/site_head.html +++ b/wowchemy/layouts/partials/site_head.html @@ -267,6 +267,14 @@ {{ $twitter_card = "summary" }} {{ end }} {{ $scr.Set "og_image" $og_image }}{{/* Set `og_image` globally for `rss.xml`. */}} + + {{ $title := "" }} + {{ with .Params.seo.title }} + {{ $title = replace . "{brand}" site.Title }} + {{ else }} + {{ $title = .Title | default site.Title }} + {{ if ne $title site.Title }}{{ $title = printf "%s | %s" $title site.Title }}{{ end }} + {{ end }} {{ with site.Params.twitter }} @@ -274,7 +282,7 @@ {{ end }} - + {{- with $og_image -}} @@ -301,5 +309,5 @@ {{ partial "cookie_consent" . }} {{ partial "custom_head" . }} - {{ if not .IsHome }}{{ .Title }} | {{ end }}{{ site.Title }} + {{$title}}