From 7b11f7fa772deb2e8e3b775dc823036fa7e29e45 Mon Sep 17 00:00:00 2001 From: Paul Bakker Date: Thu, 28 Jun 2018 22:58:54 +0200 Subject: [PATCH] Add a default Description for taxonomy pages Make use of the detection of the .Kind of page to have a default description for SEO purposes --- layouts/partials/head.html | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/layouts/partials/head.html b/layouts/partials/head.html index f619f24..43e1064 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -8,7 +8,14 @@ {{- end }} -{{- with .Description | default .Params.subtitle | default .Summary }} +{{- if eq .Kind "taxonomyTerm" }} + {{- $text := printf "Overview of all pages by %s" .Data.Singular }} + {{- $.Scratch.Set "Description" $text }} +{{- else if eq .Kind "taxonomy" }} + {{- $text := printf "Overview of all pages with the %s #%s" .Data.Singular $.Title }} + {{- $.Scratch.Set "Description" $text }} +{{- end }} +{{- with .Description | default .Params.subtitle | default .Summary | default ($.Scratch.Get "Description") }}