mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2024-12-22 12:13:19 -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>
|
||||
|
||||
{{ $img := $.Page.Resources.GetMatch (.Get "resrc") | resources.Fingerprint "sha512" }}
|
||||
|
||||
{{ if .Get "href" }}<a href="{{ .Get "href" }}">{{ end }}
|
||||
<img src="{{ .Get "src" }}"
|
||||
<img src="{{ $img.Permalink }}"
|
||||
{{ if or (.Get "alt") (.Get "caption") }}
|
||||
alt="{{ with .Get "alt" }}
|
||||
{{ . }}
|
||||
{{ else }}
|
||||
{{ .Get "caption" | markdownify }}
|
||||
{{ end }}"
|
||||
alt="{{ with .Get "alt" -}}
|
||||
{{ . -}}
|
||||
{{ else -}}
|
||||
{{ .Get "caption" | markdownify -}}
|
||||
{{ end -}}"
|
||||
{{ end }}
|
||||
|
||||
{{ with .Get "width" }} width="{{ . }}" {{ end }}
|
||||
|
Loading…
Reference in New Issue
Block a user