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

@ -48,18 +48,8 @@
{{- errorf "No handling for resource of type %q" .ResourceType -}}
{{- end -}}
</a>
{{- if or ( .Params.title ) ( .Params.attr ) -}}
{{- if or ( .Params.title ) -}}
<figcaption class="figure__caption{{ if not .Params.title }} figure__caption--no-height{{ end }}">
{{ if .Params.attrlink -}}
<a class="figcaption__attrlink" href="{{ .Params.attrlink }}"
{{- with .Params.attrtarget }} target="{{ . }}"{{ end -}}
{{- with .Params.attrrel }} rel="{{ . }}"{{ end -}}
>
{{- 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 -}}
{{- if .Params.href -}}
<a href="{{- if ( eq .Params.href "asCite" ) -}}{{ .Params.cite }}{{- else -}}{{ .Params.href }}{{- end -}}">
{{- end -}}
@ -82,6 +72,10 @@
</a>
{{- end -}}
</figcaption>
{{- end -}}
{{- if .Params -}}
{{- partial "media/attr.html" ( dict "pc" . "sc" $ "params" .Params ) -}}
{{- end -}}
</figure>
{{- end }}