fix-ogp #14

Merged
ral merged 2 commits from fix-ogp into master 2024-06-16 18:28:28 +02:00
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

Binary file not shown.

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:site_name" content="{{ .Site.Title }}"/>
<meta property="og:title" content="{{ .Title }}"/> <meta property="og:title" content="{{ .Title }}"/>
<meta property="og:url" content="{{ .Permalink | absURL }}"/> <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 }}"/> {{ $logoFile := printf "images/ogp/cosin_icon_%s.png" (string .Site.Data.cosin.date_year) }}
<meta property="og:image:type" content="image/png"/> {{ $logo := "" }}
<meta property="og:image:width" content="128"/> {{ with resources.Get $logoFile }}
<meta property="og:image:height" content="128"/> {{ $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 }}"/> <meta property="og:image:alt" content="CoSin Icon {{ string .Site.Data.cosin.date_year }}"/>
</head> </head>