refactor: resource attribution

This commit is contained in:
Ben Goldsworthy 2025-05-14 17:29:46 +02:00
parent 1a61aeade0
commit 24bfa733ba
No known key found for this signature in database
12 changed files with 169 additions and 99 deletions

View file

@ -54,13 +54,14 @@
{{- if .Get "link" }}</a>{{ end -}}
{{- if or ( .Get "caption" ) ( .Get "title" ) ( $src.Params.attr ) -}}
{{- if or ( .Get "caption" ) ( .Get "title" ) -}}
<figcaption class="figure__caption{{ if not ( or ( .Get "caption" ) ( .Get "title" ) ) }} figure__caption--no-height{{ end }}">
{{- if .Params.attrlink -}}<a class="figcaption__attrlink" href="{{ .Params.attrlink }}">{{- end -}}
{{- if .Params.attr -}}<p class="figcaption__attr">{{ .Params.attr | safeHTML }}{{ with .Params.attrlicence }} <span class="figcaption__licence">{{ . | safeHTML }}</span>{{ end }}</p>{{- end -}}
{{- if .Params.attrlink -}}</a>{{- end -}}
{{- with .Get "title" -}}<h4 class="figcaption__title">{{ . | markdownify | safeHTML }}</h4>{{- end -}}
{{- with .Get "caption" -}}<p class="figcaption__caption">{{ . | markdownify | safeHTML }}</p>{{- end -}}
</figcaption>
{{- end -}}
{{- if $src.Params -}}
{{- partial "media/attr.html" ( dict "pc" . "sc" $ "params" $src.Params ) -}}
{{- end -}}
</figure>