Fixes #356 Co-authored-by: amreo <amreo0x+github@protonmail.com> Co-authored-by: paspo <paolo@asperti.com> Reviewed-on: #365 Reviewed-by: Paolo Asperti <paspo@noreply.libreschool.org>
26 lines
1.1 KiB
HTML
26 lines
1.1 KiB
HTML
<div>
|
|
|
|
{{- $imgsrc := .Page.Resources.GetMatch (.Get "src") -}}
|
|
<img src="{{ $imgsrc.RelPermalink }}" alt="{{ .Get "alt" }}" title="{{ .Get "title" }}">
|
|
|
|
<figcaption>
|
|
{{ if strings.HasPrefix (.Get "source") "http" }}
|
|
<small class="image-source">🛈 {{ T "source" }}: <a href="{{ .Get "source" }}" target="_blank">{{ .Get "source" }}</a></small>
|
|
{{ else if ne (.Get "source") "" }}
|
|
<small class="image-source">🛈 {{ T "source" }}: {{ .Get "source" }}</small>
|
|
{{ end }}
|
|
|
|
{{ if ne (.Get "author") "" }}
|
|
<small class="image-source">🧑🎨 {{ T "author" }}: {{ .Get "author" }}</small>
|
|
{{ end }}
|
|
|
|
|
|
{{ if ne (.Get "license-text") "" }}
|
|
{{ if strings.HasPrefix (.Get "license-url") "http" }}
|
|
<small class="image-source">📄 {{ T "license" }}: <a href="{{ .Get "license-url" }}" target="_blank">{{ .Get "license-text" }}</a></small>
|
|
{{ else }}
|
|
<small class="image-source">📄 {{ T "license" }}: {{ .Get "license-text" }}</small>
|
|
{{ end }}
|
|
{{ end }}
|
|
</figcaption>
|
|
</div> |