From 102e089bc3c1cf30a0f5b204c0182e0ce72b6880 Mon Sep 17 00:00:00 2001 From: Razon Yang Date: Sat, 4 Nov 2023 15:01:23 +0530 Subject: [PATCH] [PATCH] tpl/embedded: Make Open Graph's series optional cherry-picked from https://github.com/gohugoio/hugo/commit/b82b547acb404cdb883154cc4991137d46caa22a --- layouts/partials/templates/opengraph.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/layouts/partials/templates/opengraph.html b/layouts/partials/templates/opengraph.html index 9e8df143..631dda14 100644 --- a/layouts/partials/templates/opengraph.html +++ b/layouts/partials/templates/opengraph.html @@ -41,12 +41,14 @@ {{- /* If it is part of a series, link to related articles */}} {{- $permalink := .Permalink }} {{- $siteSeries := site.Taxonomies.series }} +{{- if $siteSeries }} {{ with .Params.series }}{{- range $name := . }} {{- $series := index $siteSeries ($name | urlize) }} {{- range $page := first 6 $series.Pages }} {{- if ne $page.Permalink $permalink }}{{ end }} {{- end }} {{ end }}{{ end }} +{{- end }} {{- /* Facebook Page Admin ID for Domain Insights */}} {{- with site.Social.facebook_admin }}{{ end }}