2018-07-13 03:22:43 +00:00
|
|
|
<div class="columns is-img-preview">
|
|
|
|
{{ range $param := .Params }}
|
|
|
|
<!-- image -->
|
|
|
|
{{ $items := split $param "|" }}
|
|
|
|
{{ $src := (index $items 0) }}
|
|
|
|
{{ $title := (index $items 1) }}
|
2018-07-15 05:59:40 +00:00
|
|
|
{{ $split_src := split $src "." }}
|
|
|
|
{{ $extension := index $split_src (sub (len $split_src) 1) }}
|
2018-12-02 22:59:30 +00:00
|
|
|
<div class="column has-text-centered">
|
2018-07-15 05:59:40 +00:00
|
|
|
{{ if eq $extension "mp4" }}
|
|
|
|
<video preload="auto" autoplay="autoplay" muted="muted" loop="loop" webkit-playsinline="">
|
|
|
|
<source src="{{ $src }}" type="video/mp4">
|
|
|
|
Your browser doesn't support mp4 video. :(
|
|
|
|
</video>
|
|
|
|
{{ else }}
|
|
|
|
<a href="{{ $src }}" title="{{ $title }}">
|
2021-01-13 00:10:02 +00:00
|
|
|
{{- if eq $extension "png" -}}
|
2020-07-28 07:32:51 +00:00
|
|
|
<img src="{{ $src }}.jpg" alt="{{ $title }}">
|
2021-01-13 00:10:02 +00:00
|
|
|
{{- else -}}
|
|
|
|
<img src="{{ $src }}" alt="{{ $title }}">
|
|
|
|
{{- end -}}
|
2018-07-15 05:59:40 +00:00
|
|
|
</a>
|
|
|
|
{{ end }}
|
2018-07-13 03:22:43 +00:00
|
|
|
{{ if $title }}
|
|
|
|
<p class="has-text-centered is-italic has-text-grey-light">{{ $title }}</p>
|
|
|
|
{{ end }}
|
|
|
|
</div>
|
|
|
|
{{ end }}
|
2018-07-15 05:59:40 +00:00
|
|
|
</div>
|