better img shortcode -> lazy option default true
This commit is contained in:
parent
c4ab5ffeb0
commit
0ee469442a
|
@ -1,5 +1,5 @@
|
||||||
{{ $base := (findRE "/[a-zA-Z0-9_]+/" .Site.BaseURL | default "/") }}
|
{{ $base := (findRE "/[a-zA-Z0-9_]+/" .Site.BaseURL | default "/") }}
|
||||||
{{ if not (.Get "lazy") }}
|
{{ if or (eq (.Get "lazy") false) (eq (.Get "lazy") "false") }}
|
||||||
<figure {{ with .Get "class" }}class="{{ . }}" {{ end }}>
|
<figure {{ with .Get "class" }}class="{{ . }}" {{ end }}>
|
||||||
{{ with .Get "link"}}<a href="{{ . }}">{{ end }}
|
{{ with .Get "link"}}<a href="{{ . }}">{{ end }}
|
||||||
<img src="{{ if eq $base "/" }}{{ .Get "src" }}{{ else }}{{ delimit $base "" }}{{ substr (.Get "src") 1 }}{{ end }}" {{ if or (.Get "alt") (.Get "caption") }}alt="{{ with .Get "alt"}}{{.}}{{else}}{{ .Get "caption" }}{{ end }}"{{ end }} style="width:{{ .Get "width" }};height:{{ .Get "height" }};"/>
|
<img src="{{ if eq $base "/" }}{{ .Get "src" }}{{ else }}{{ delimit $base "" }}{{ substr (.Get "src") 1 }}{{ end }}" {{ if or (.Get "alt") (.Get "caption") }}alt="{{ with .Get "alt"}}{{.}}{{else}}{{ .Get "caption" }}{{ end }}"{{ end }} style="width:{{ .Get "width" }};height:{{ .Get "height" }};"/>
|
||||||
|
|
Loading…
Reference in New Issue