cosin-website/layouts/partials/opengraph.html

15 lines
770 B
HTML
Raw Permalink Normal View History

2024-06-16 19:06:33 +02:00
{{ $fileName := printf "images/ogp/cosin_icon_%s.png" (string .Site.Data.cosin.date_year) }}
{{ $logo := or (resources.Get $fileName) (resources.Get "images/ogp/cosin_icon_generic.png") }}
<meta property="og:type" content="website"/>
<meta property="og:site_name" content="{{ .Site.Title }}"/>
<meta property="og:title" content="{{ .Title }}"/>
<meta property="og:url" content="{{ .Permalink | absURL }}"/>
{{ with $logo }}
<meta property="og:image" content="{{ .Permalink }}"/>
<meta property="og:image:type" content="{{ .MediaType }}"/>
<meta property="og:image:width" content="{{ .Width }}"/>
<meta property="og:image:height" content="{{ .Height }}"/>
<meta property="og:image:alt" content="CoSin Icon {{ string $.Site.Data.cosin.date_year }}"/>
{{ end }}