mirror of
https://github.com/yuzu-emu/shared-bulma-theme.git
synced 2024-12-22 23:45:38 +00:00
shortcodes: add support for picture comparisons
This commit is contained in:
parent
9f449cfedd
commit
ea75958a39
2
layouts/shortcodes/imgs-compare-include-end.html
Normal file
2
layouts/shortcodes/imgs-compare-include-end.html
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/juxtaposejs@1.1.6/build/js/juxtapose.min.js"></script>
|
||||||
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/juxtaposejs@1.1.6/build/css/juxtapose.css">
|
22
layouts/shortcodes/single-title-imgs-compare.html
Normal file
22
layouts/shortcodes/single-title-imgs-compare.html
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
{{ $title := .Get 0 }}
|
||||||
|
<div class="columns is-bottom-marginless">
|
||||||
|
<div class="column is-bottom-paddingless juxtapose">
|
||||||
|
{{ range $param := last 2 .Params }}
|
||||||
|
<!-- image -->
|
||||||
|
{{ $items := split $param "|" }}
|
||||||
|
{{ $src := (index $items 0) }}
|
||||||
|
{{ $subtitle := (index $items 1) }}
|
||||||
|
{{ $split_src := split $src "." }}
|
||||||
|
{{ $extension := index $split_src (sub (len $split_src) 1) }}
|
||||||
|
{{- if eq $extension "png" -}}
|
||||||
|
<img src="{{ $src }}.jpg" alt="{{ $title }}">
|
||||||
|
{{- else -}}
|
||||||
|
<img src="{{ $src }}" alt="{{ $title }}">
|
||||||
|
{{- end -}}
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{ if $title }}
|
||||||
|
<p class="has-text-centered is-italic has-text-grey-light">{{ $title }}</p>
|
||||||
|
{{ end }}
|
Loading…
Reference in a new issue