mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2024-11-17 13:25:57 -06:00
Use page resources in figure shortcode (and hash the images)
This commit is contained in:
parent
b51c6c257f
commit
61ac27bdf9
@ -1,13 +1,15 @@
|
|||||||
<figure>
|
<figure>
|
||||||
|
|
||||||
|
{{ $img := $.Page.Resources.GetMatch (.Get "resrc") | resources.Fingerprint "sha512" }}
|
||||||
|
|
||||||
{{ if .Get "href" }}<a href="{{ .Get "href" }}">{{ end }}
|
{{ if .Get "href" }}<a href="{{ .Get "href" }}">{{ end }}
|
||||||
<img src="{{ .Get "src" }}"
|
<img src="{{ $img.Permalink }}"
|
||||||
{{ if or (.Get "alt") (.Get "caption") }}
|
{{ if or (.Get "alt") (.Get "caption") }}
|
||||||
alt="{{ with .Get "alt" }}
|
alt="{{ with .Get "alt" -}}
|
||||||
{{ . }}
|
{{ . -}}
|
||||||
{{ else }}
|
{{ else -}}
|
||||||
{{ .Get "caption" | markdownify }}
|
{{ .Get "caption" | markdownify -}}
|
||||||
{{ end }}"
|
{{ end -}}"
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ with .Get "width" }} width="{{ . }}" {{ end }}
|
{{ with .Get "width" }} width="{{ . }}" {{ end }}
|
||||||
|
Loading…
Reference in New Issue
Block a user