Toevoegen shortcode om sponsor in content te 'includen'

This commit is contained in:
Michael Boelen 2024-02-01 15:16:05 +01:00
parent 2bc3e66918
commit 46f4d2925b

View file

@ -0,0 +1,12 @@
{{ $id := .Get "id" }}
{{ with (index $.Site.Data.sponsoren $id) }}
<div>
<strong>{{ .name }}</strong>
{{ if .icon_small }}
{{ $alttext := printf "Logo van %s" .name }}
{{ if .url }}<a href="{{ .url }}" rel="nofollow">{{ end }}
{{ partial "show-image.html" (dict "context" . "image" .icon_small "alt" $alttext) }}
{{ if .url }}</a>{{ end }}
{{ end }}
</div>
{{ end }}