Add image enlargement

This commit is contained in:
2021-11-10 23:15:13 +01:00
parent a6d96dbdc2
commit 9ab6b65570
6 changed files with 126 additions and 9 deletions
@@ -1,4 +1,4 @@
<figure{{ with .Get "class" }} class="{{ . }}" {{ end }}{{ with .Get "id" }} id="{{ . }}" {{ end }}>
<figure class="enlargable {{- with .Get "class" }} {{ . }}{{ end }}" {{ with .Get "id" }} id="{{ . }}" {{ end }}>
{{- if .Get "link" -}}
<a href="{{ .Get "link" }}" {{ with .Get "target" }} target="{{ . }}" {{ end }}{{ with .Get "rel" }} rel="{{ . }}"
{{ end }}>
@@ -9,7 +9,7 @@
alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" | markdownify| plainify }}{{ end }}" {{- end -}}
width="{{ .Get "width" | default $img.Width }}" height="{{ .Get "height" | default $img.Height }}" />
{{- else }}
{{- partial "image.html" (dict "path" (.Get "src") "alt" (or (.Get "alt") (.Get "caption" | markdownify | plainify)) "width" (.Get "width") "height" (.Get "height")) }}
{{- partial "image.html" (dict "path" (.Get "src") "alt" (or (.Get "alt") (or (.Get "caption" | markdownify | plainify) (.Get "title"))) "width" (.Get "width") "height" (.Get "height")) }}
{{- end }}
{{- if .Get "link" }}</a>{{ end -}}
{{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}}
@@ -33,4 +33,4 @@
{{- end -}}
</figcaption>
{{- end }}
</figure>
</figure>