From 869a690109cd61522a6d1c5c7d6e7e82b6461bd2 Mon Sep 17 00:00:00 2001 From: Rotzbua Date: Mon, 25 Mar 2024 14:19:49 +0100 Subject: [PATCH] fix(html): remove trailing slash on void elements Additional context: https://developer.mozilla.org/en-US/docs/Glossary/Void_element --- layouts/partials/templates/opengraph.html | 32 +++++++++---------- layouts/partials/templates/twitter_cards.html | 18 +++++------ 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/layouts/partials/templates/opengraph.html b/layouts/partials/templates/opengraph.html index 95f037c..3ac3567 100644 --- a/layouts/partials/templates/opengraph.html +++ b/layouts/partials/templates/opengraph.html @@ -1,33 +1,33 @@ - - - - + + + + {{- if .Params.cover.image -}} {{- if (ne .Params.cover.relative true) }} - + {{- else}} - + {{- end}} {{- else }} {{- $images := partial "partials/templates/_funcs/get-page-images" . -}} {{- range first 6 $images }} - + {{ end -}} {{- end }} {{- if .IsPage }} {{- $iso8601 := "2006-01-02T15:04:05-07:00" -}} - -{{ with .PublishDate }}{{ end }} -{{ with .Lastmod }}{{ end }} + +{{ with .PublishDate }}{{ end }} +{{ with .Lastmod }}{{ end }} {{- end -}} -{{- with .Params.audio }}{{ end }} -{{- with .Params.locale }}{{ end }} -{{- with site.Params.title }}{{ end }} +{{- with .Params.audio }}{{ end }} +{{- with .Params.locale }}{{ end }} +{{- with site.Params.title }}{{ end }} {{- with .Params.videos }}{{- range . }} - + {{ end }}{{ end }} {{- /* If it is part of a series, link to related articles */}} @@ -37,7 +37,7 @@ {{ with .Params.series }}{{- range $name := . }} {{- $series := index $siteSeries ($name | urlize) }} {{- range $page := first 6 $series.Pages }} - {{- if ne $page.Permalink $permalink }}{{ end }} + {{- if ne $page.Permalink $permalink }}{{ end }} {{- end }} {{ end }}{{ end }} {{- end }} @@ -56,4 +56,4 @@ {{- end }} {{- /* Facebook Page Admin ID for Domain Insights */}} -{{ with $facebookAdmin }}{{ end }} +{{ with $facebookAdmin }}{{ end }} diff --git a/layouts/partials/templates/twitter_cards.html b/layouts/partials/templates/twitter_cards.html index 46b0d04..88bf24b 100644 --- a/layouts/partials/templates/twitter_cards.html +++ b/layouts/partials/templates/twitter_cards.html @@ -1,21 +1,21 @@ {{- if .Params.cover.image -}} - + {{- if (ne $.Params.cover.relative true) }} - + {{- else }} - + {{- end}} {{- else }} {{- $images := partial "partials/templates/_funcs/get-page-images" . -}} {{- with index $images 0 -}} - - + + {{- else -}} - + {{- end -}} {{- end }} - - + + {{- /* Deprecate site.Social.twitter in favor of site.Params.social.twitter */}} {{- $twitterSite := "" }} {{- with site.Params.social }} @@ -34,5 +34,5 @@ {{- if not (strings.HasPrefix . "@") }} {{- $content = printf "@%v" $twitterSite }} {{- end }} - + {{- end }}