diff options
Diffstat (limited to 'layouts/shortcodes/img-fit.html')
-rw-r--r-- | layouts/shortcodes/img-fit.html | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/layouts/shortcodes/img-fit.html b/layouts/shortcodes/img-fit.html index 08e8224..b8603d2 100644 --- a/layouts/shortcodes/img-fit.html +++ b/layouts/shortcodes/img-fit.html @@ -39,37 +39,37 @@ --> {{ $numOfParams := sub (len .Params) 1 }} {{ if and (ge $numOfParams 3) (not (modBool $numOfParams 2)) }} - {{ $.Scratch.Set "path" (.Get $numOfParams) }} + {{ $.Scratch.Set "path" (.Get $numOfParams) }} - {{ $.Scratch.Set "structType" "shortcode" }} - {{ partial "img-path" . }} - {{ $path := $.Scratch.Get "path" }} + {{ $.Scratch.Set "structType" "shortcode" }} + {{ partial "img-path" . }} + {{ $path := $.Scratch.Get "path" }} - <div class="box alt"> - <div class="row uniform"> - {{ $.Scratch.Set "count" 1 }} - {{ $.Scratch.Set "imgFile" "" }} - {{ range first $numOfParams .Params }} - {{ if eq ($.Scratch.Get "count") 1 }} - <div class="{{ . }}"> - {{ else if eq ($.Scratch.Get "count") 2 }} - {{ if eq . "" }} - </div> - {{ $.Scratch.Set "imgFile" "" }} - {{ else }} - {{ $.Scratch.Set "imgFile" . }} - <span class="image fit"> - {{ end }} - {{ else }} - {{ if ne ($.Scratch.Get "imgFile") "" }} - <img src='{{ $path }}/{{ $.Scratch.Get "imgFile" }}' - alt="{{ . }}" /> - </span></div> - {{ end }} - {{ $.Scratch.Set "count" 0 }} - {{ end }} - {{ $.Scratch.Add "count" 1 }} + <div class="box alt"> + <div class="row uniform"> + {{ $.Scratch.Set "count" 1 }} + {{ $.Scratch.Set "imgFile" "" }} + {{ range first $numOfParams .Params }} + {{ if eq ($.Scratch.Get "count") 1 }} + <div class="{{ . }}"> + {{ else if eq ($.Scratch.Get "count") 2 }} + {{ if eq . "" }} + </div> + {{ $.Scratch.Set "imgFile" "" }} + {{ else }} + {{ $.Scratch.Set "imgFile" . }} + <span class="image fit"> {{ end }} - </div> + {{ else }} + {{ if ne ($.Scratch.Get "imgFile") "" }} + <img src='{{ $path }}/{{ $.Scratch.Get "imgFile" }}' alt="{{ . }}" /> + </span> + </div> + {{ end }} + {{ $.Scratch.Set "count" 0 }} + {{ end }} + {{ $.Scratch.Add "count" 1 }} + {{ end }} </div> + </div> {{ end }} |