From 900bb5e845c3ad44defbd427cae3d44a4a43321f Mon Sep 17 00:00:00 2001 From: ivarlovlie Date: Sat, 25 Feb 2023 13:15:44 +0100 Subject: feat: Initial commit --- .../frontpage/layouts/partials/head/opengraph.html | 69 ++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 code/frontpage/layouts/partials/head/opengraph.html (limited to 'code/frontpage/layouts/partials/head/opengraph.html') diff --git a/code/frontpage/layouts/partials/head/opengraph.html b/code/frontpage/layouts/partials/head/opengraph.html new file mode 100644 index 0000000..6127e82 --- /dev/null +++ b/code/frontpage/layouts/partials/head/opengraph.html @@ -0,0 +1,69 @@ + + + + +{{ if $.Scratch.Get "paginator" -}} + {{ $paginator := .Paginate (where .Site.RegularPages.ByDate.Reverse "Section" "blog" ) -}} + +{{ else -}} + +{{ end -}} +{{ with .Site.Params.title -}} + +{{ end -}} + +{{ $iso8601 := "2006-01-02T15:04:05-07:00" -}} +{{ if .IsPage -}} + {{ if not .PublishDate.IsZero -}} + + {{ else if not .Date.IsZero -}} + + {{ end -}} + {{ if not .Lastmod.IsZero -}} + + {{ end -}} +{{ else -}} + {{ if not .Date.IsZero -}} + + {{ end -}} +{{ end -}} + +{{ if eq .Kind "home" -}} + {{ .Scratch.Set "title" .Site.Params.titleHome -}} +{{ else -}} + {{ .Scratch.Set "title" .Title -}} +{{ end -}} + +{{ with $.Params.images -}} + {{ range first 6 . -}} + + {{ end -}} +{{ else -}} + {{ $images := $.Resources.ByType "image" -}} + {{ $featured := $images.GetMatch "*feature*" -}} + {{ if not $featured -}} + {{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }} + {{ end -}} + {{ with $featured -}} + + {{ else -}} + {{ with $.Site.Params.images -}} + + + {{ end -}} + {{ end -}} +{{ end -}} + +{{ with $.Site.Params.images -}} + {{ $.Scratch.Set "primaryImage" (index . 0 | absURL) -}} +{{ end -}} + +{{ with .Params.audio -}} + +{{ end -}} + +{{ with .Params.videos -}} + {{ range . -}} + + {{ end -}} +{{ end -}} -- cgit v1.3