2023-05-21 15:23:29 +02:00
|
|
|
{{ $images := $.Resources.ByType "image" }}
|
|
|
|
{{ $featured := $images.GetMatch "*feature*" }}
|
|
|
|
{{ if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end }}
|
|
|
|
{{ if not $featured }}
|
|
|
|
{{ $featured = resources.Get "/opengraph/background.png" }}
|
2024-01-27 16:12:50 +01:00
|
|
|
{{ $size := 60 }}
|
2023-05-21 15:23:29 +02:00
|
|
|
{{ $title := $.LinkTitle }}
|
|
|
|
{{ if gt (len $title) 20 }}
|
2024-01-27 16:12:50 +01:00
|
|
|
{{ $size = 50 }}
|
2023-05-21 15:23:29 +02:00
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ $text := $title }}
|
2024-01-27 16:12:50 +01:00
|
|
|
{{ $textOptions := dict
|
|
|
|
"color" "#221F5F"
|
2023-05-21 15:23:29 +02:00
|
|
|
"size" $size
|
|
|
|
"lineSpacing" 10
|
2024-01-27 16:12:50 +01:00
|
|
|
"x" 45 "y" 140
|
2023-05-21 15:23:29 +02:00
|
|
|
"font" (resources.Get "/opengraph/mulish-black.ttf")
|
|
|
|
}}
|
|
|
|
|
|
|
|
{{ $featured = $featured | images.Filter (images.Text $text $textOptions) }}
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ return $featured }}
|