Files
website-hugo/themes/lhs/layouts/shortcodes/bimage.html
engineershamrock e8d1e1785a Updated for image size problem
bimage short code and index.md updated
2024-07-03 18:46:56 +01:00

25 lines
715 B
HTML

{{ $img := .Page.Resources.GetMatch (printf "*%s*" (.Get "src")) }}
{{ $width := .Get "width" }}
{{ $height := .Get "height" }}
{{ $zone := .Get "zone" }}
{{ $title := .Get "title" }}
{{ $class := .Get "class" }}
{{- with .Parent -}}
<div>
{{ end }}
<div style="display: block; margin-left: auto; margin-right: auto; width: {{ $zone }}%;">
<figure class="image{{ if $class }} {{ $class }}{{ end }}">
<img src="{{ $img.RelPermalink }}" width="{{ $width }}px" height="{{ $height }}px" {{ if $title }}
alt="{{ $title }}" {{ end }}>
{{ if $title }}
<figcaption class="is-size-6">
<small>
{{ $title }}
</small>
</figcaption>
{{ end }}
</figure>
</div>
{{- with .Parent -}}
</div>
{{ end }}