mirror of
https://github.com/nikdoof/website-hugo.git
synced 2025-12-13 13:22:22 +00:00
NAS Storage blog post Added `aimage`, `bimage`, `bgallery` and `fimage` custom shortcodes
24 lines
613 B
HTML
24 lines
613 B
HTML
{{ $img := .Page.Resources.GetMatch (printf "*%s*" (.Get "src")) }}
|
|
{{ $width := .Get "width" }}
|
|
{{ $height := .Get "height" }}
|
|
{{ $title := .Get "title" }}
|
|
{{ $class := .Get "class" }}
|
|
{{- with .Parent -}}
|
|
<div style="width:{{$width}}px">
|
|
{{ end }}
|
|
<figure class="image{{ if $class }} {{ $class }}{{ end }}">
|
|
<img src="{{ $img.RelPermalink }}" width="{{$width}}px" heigth="{{$height}}px" {{ if $title }}
|
|
alt="{{ $title }}" {{ end }}>
|
|
{{ if $title }}
|
|
<figcaption class="is-size-6">
|
|
<small>
|
|
{{ $title }}
|
|
</small>
|
|
</figcaption>
|
|
{{ end }}
|
|
</figure>
|
|
{{- with .Parent -}}
|
|
|
|
|
|
</div>
|
|
{{ end }} |