From 5e20b8d99cd4591cc9d066370139d210d673864c Mon Sep 17 00:00:00 2001 From: Oscar Najera Date: Thu, 7 Sep 2023 02:37:36 +0200 Subject: metadata for social media I must here also change how the page image is stored --- layouts/_default/single.html | 7 +++---- layouts/partials/head.html | 6 ++++++ layouts/partials/hero.html | 2 +- layouts/partials/post.html | 5 ++--- 4 files changed, 12 insertions(+), 8 deletions(-) (limited to 'layouts') diff --git a/layouts/_default/single.html b/layouts/_default/single.html index d12dd07..6538e4f 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -8,12 +8,11 @@

{{ . }}

{{end}} - {{ if isset .Params "image" }} - {{ $image := resources.Get .Params.image }} - {{ $image := $image.Fill (default "400x400" .Params.image_size) }} + {{ with resources.Get (index .Params.images 0) | default (resources.Get .Params.image) }} + {{ $image := .Fill (default "400x400" $.Params.image_size) }}
{{ .Title }} - {{ with .Params.caption }} + {{ with $.Params.caption }} {{ .text }} diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 7e88275..bd6d93f 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -2,6 +2,9 @@ +{{ template "_internal/twitter_cards.html" . }} +{{ template "_internal/opengraph.html" . }} + {{ with resources.Get "scss/style.scss" | resources.ToCSS (dict "includePaths" (slice "node_modules") "targetPath" "css/style.css") | resources.Minify | fingerprint }} {{ end }} @@ -10,4 +13,7 @@ {{ if .IsHome }}{{ $title = .Site.Title }}{{ end }} {{ $title }} +{{ range .AlternativeOutputFormats -}} +{{ printf `` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} +{{ end -}} diff --git a/layouts/partials/hero.html b/layouts/partials/hero.html index 263bb03..4729291 100644 --- a/layouts/partials/hero.html +++ b/layouts/partials/hero.html @@ -1,4 +1,4 @@ -