From 2ecb63e7b2f9543ec52a4cf45d64ce89e29377ee Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Fri, 18 Feb 2022 14:03:19 +0100 Subject: [PATCH] fix: fix isPage detection for metatdata tags (#348) --- layouts/partials/microformats/opengraph.html | 8 +++++--- layouts/partials/microformats/schema.html | 3 ++- layouts/partials/utils/description.html | 3 ++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/layouts/partials/microformats/opengraph.html b/layouts/partials/microformats/opengraph.html index 574420c..97716ca 100644 --- a/layouts/partials/microformats/opengraph.html +++ b/layouts/partials/microformats/opengraph.html @@ -1,4 +1,6 @@ -{{- if not (eq .Kind "home") }} +{{ $isPage := or (and (ne .Type "posts") (in "section page" .Kind )) (and (eq .Type "posts") (eq .Kind "page")) }} + +{{- if ne .Kind "home" }} {{- end }} - + {{- with .Params.audio }} @@ -43,7 +45,7 @@ {{- end }} {{- end }} -{{ if .IsPage -}} +{{ if $isPage -}} {{- $iso8601 := "2006-01-02T15:04:05-07:00" -}} {{- with .PublishDate }} diff --git a/layouts/partials/microformats/schema.html b/layouts/partials/microformats/schema.html index ba841b7..4b7ff57 100644 --- a/layouts/partials/microformats/schema.html +++ b/layouts/partials/microformats/schema.html @@ -1,3 +1,4 @@ +{{ $isPage := or (and (ne .Type "posts") (in "section page" .Kind )) (and (eq .Type "posts") (eq .Kind "page")) }} {{- if eq .Kind "home" }} -{{- else if or (and (not (eq .Type "posts")) (in "section page" .Kind )) (and (eq .Type "posts") (eq .Kind "page")) }} +{{- else if $isPage }}