selfprivacy.org/layouts/shortcodes/image-container.html

41 lines
1.8 KiB
HTML
Raw Normal View History

2023-01-11 16:53:46 +00:00
{{ $illustration := .Page.Resources.GetMatch (printf "**%s*" (.Get 0)) }}
{{ $title := .Get 1 }}
2024-06-02 00:15:09 +00:00
{{ $attr := .Get 2 }}
{{ $side := .Get 3 }}
2024-06-02 00:15:09 +00:00
{{ if eq $side "right" }}
2024-06-02 00:15:09 +00:00
<div class="d-flex flex-column flex-lg-row flex-xl-row justify-content-center align-items-center my-auto {{$attr}}">
<div class="col-xl-4 col-lg-6 col-md-8 col-xs-12 px-5">
2023-01-11 16:53:46 +00:00
{{ if $title }}
2024-06-02 00:15:09 +00:00
<h2 class="image-container-title">{{ $title }}</h2>
2023-01-11 16:53:46 +00:00
{{ end }}
{{ .Inner }}
</div>
{{ if $illustration }}
2024-04-27 13:17:09 +00:00
<div class="col-lg-4 col-md-6 col-sm-8 col-xs-12">
<object role="img" class="my-auto d-flex justify-content-center align-items-center card-img-top" type="image/svg+xml" data="{{ $illustration.RelPermalink }}">
2024-06-02 00:15:09 +00:00
<div class="error image-container-img">
<i class="fa-solid fa-triangle-exclamation"></i>
</div>
</object>
2024-04-27 13:17:09 +00:00
</div>
2023-01-11 16:53:46 +00:00
{{ end }}
{{ else }}
2024-06-02 00:15:09 +00:00
<div class="d-flex flex-column-reverse flex-lg-row flex-xl-row justify-content-center align-items-center {{$attr}}">
2023-01-11 16:53:46 +00:00
{{ if $illustration }}
2024-04-27 13:17:09 +00:00
<div class="col-lg-4 col-md-6 col-sm-8 col-xs-12">
<object role="img" class="col-lg-4 col-md-6 col-sm-8 col-xs-12 my-auto d-flex justify-content-center align-items-center card-img-top" type="image/svg+xml" data="{{ $illustration.RelPermalink }}">
2024-06-02 00:15:09 +00:00
<div class="error image-container-img">
<i class="fa-solid fa-triangle-exclamation"></i>
</div>
</object>
2024-04-27 13:17:09 +00:00
</div>
2023-01-11 16:53:46 +00:00
{{ end }}
<div class="col-xl-4 col-lg-6 col-md-8 col-xs-12 px-5">
2023-01-11 16:53:46 +00:00
{{ if $title }}
2024-06-02 00:15:09 +00:00
<h2 class="image-container-title">{{ $title }}</h2>
2023-01-11 16:53:46 +00:00
{{ end }}
{{ .Inner }}
</div>
{{ end }}
</div>