Use page assets for ogp template
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
BIN
assets/images/ogp/cosin_icon_generic.png
Normal file
After Width: | Height: | Size: 8.9 KiB |
|
@ -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>
|
||||
|
|