Use page assets for ogp template
All checks were successful
/ test (push) Successful in 28s
/ deploy (push) Successful in 1m15s

This commit is contained in:
Ral 2024-06-16 18:25:46 +02:00
parent 2429e19bee
commit 984b3b2c1c
7 changed files with 11 additions and 4 deletions

View file

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View file

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View file

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

View file

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

View file

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

View file

@ -13,10 +13,17 @@
<meta property="og:site_name" content="{{ .Site.Title }}"/>
<meta property="og:title" content="{{ .Title }}"/>
<meta property="og:url" content="{{ .Permalink | absURL }}"/>
<meta property="og:image" content="{{ printf "images/ogp/cosin_icon_%s.png" (string .Site.Data.cosin.date_year) | absURL }}"/>
<meta property="og:image:type" content="image/png"/>
<meta property="og:image:width" content="128"/>
<meta property="og:image:height" content="128"/>
{{ $logoFile := printf "images/ogp/cosin_icon_%s.png" (string .Site.Data.cosin.date_year) }}
{{ $logo := "" }}
{{ with resources.Get $logoFile }}
{{ $logo = . }}
{{ else }}
{{ $logo = resources.Get "images/ogp/cosin_icon_generic.png" }}
{{ end }}
<meta property="og:image" content="{{ $logo | absURL }}"/>
<meta property="og:image:type" content="{{ $logo.MediaType }}"/>
<meta property="og:image:width" content="{{ $logo.Width }}"/>
<meta property="og:image:height" content="{{ $logo.Height }}"/>
<meta property="og:image:alt" content="CoSin Icon {{ string .Site.Data.cosin.date_year }}"/>
</head>