Rename figure.html to image.html
This commit is contained in:
20
layouts/shortcodes/paige/image.html
Normal file
20
layouts/shortcodes/paige/image.html
Normal file
@@ -0,0 +1,20 @@
|
||||
<figure {{ if eq (.Get `inline`) true }} class="figure"{{ else }} class="align-items-center d-flex flex-column"{{ end }}>
|
||||
{{ $link := .Get 2 | default (.Get `link`) }}
|
||||
{{ with $link }}
|
||||
<a href="{{ . }}">
|
||||
{{ end }}
|
||||
{{ $src := .Get 0 | default (.Get `src`) }}
|
||||
{{ $url := urls.Parse $src }}
|
||||
{{ if and (not $url.IsAbs) (not (hasPrefix $url.Path "/")) }}
|
||||
{{ with .Page.Resources.Get $src }}
|
||||
{{ $src = .RelPermalink }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<img{{ with (.Get 4 | default (.Get `alt`)) }} alt="{{ . }}"{{ end }} class="figure-img img-fluid"{{ with .Get `height` }} height="{{ . }}"{{ end }} src="{{ $src }}"{{ with (.Get 3 | default (.Get `title`)) }} title="{{ . }}"{{ end }}{{ with .Get `width` }} width="{{ . }}"{{ end }}>
|
||||
{{ if $link }}
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ with (.Get 1 | default (.Get `caption`)) }}
|
||||
<figcaption class="figure-caption">{{ . }}</figcaption>
|
||||
{{ end }}
|
||||
</figure>
|
Reference in New Issue
Block a user