Welcome to mirror list, hosted at ThFree Co, Russian Federation.

fluid_imgs.html « shortcodes « layouts - github.com/heyeshuang/hugo-theme-tokiwa.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f89977279124e74b5e6474e283d53df7474eeaf4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{{ $paramCount := len .Params }}
{{ if gt $paramCount 0 }}
<div class="pure-g">
{{ range $param := .Params }}
  {{ $items := split $param "|" }}
  {{ $itemCount := len $items }}
  <!-- Item count must be at least 2 as
  "class" and "src" must be specified -->
  {{ if ge $itemCount 2 }}
  <div class="{{ index $items 0 }}">
    <div style="padding: 0 .2em">
      <img
        class="pure-img-responsive"
        src="{{ index $items 1 }}"
        alt="{{ if ge $itemCount 3 }}{{ index $items 2 }}{{ else }}{{ "" }}{{ end }}">
    </div>
  </div>
  {{ end }}
{{ end }}
</div>
{{ end }}