swh:1:snp:9f90daa2f0cb7e83b3230a52ab396e3b6448c798
Tip revision: 17d7a0d31873783398506bc500cfa009e98d1a23 authored by LuisGC on 24 November 2018, 20:23:48 UTC
testing new image and build command
testing new image and build command
Tip revision: 17d7a0d
img-path.html
<!-- This partial is used by the img shortcodes and the template,
featured in the post type
Set the path depending on the value passed through
if path is title then it will use the LinkTitle from the Page variable
if path is date then it will format the directory to year/date i.e. 2006/01
Note: path will be concatenated to the root directory, img
otherwise use the explicit path provided by the user
-->
{{ $src := $.Scratch.Get "path" }}
{{ $alt := $.Scratch.Get "featuredalt" }}
{{ $img := $.Scratch.Get "featured" }}
{{ $structType := $.Scratch.Get "structType" }}
{{ if eq $src "date" }}
{{ $.Scratch.Set "path" "/img/" }}
{{ if eq $structType "shortcode" }}
{{ $.Scratch.Add "path" (.Page.Date.Format "2006/01") }}
{{ else }}
{{ $.Scratch.Add "path" (.Date.Format "2006/01") }}
{{ end }}
{{ else }}
{{ $.Scratch.Set "path" $src }}
{{ end }}