{{ define "main" }} {{ .Title }} {{ .Content }} {{ if in (lower .Params.Mode) "one" }} {{ $basename := (replace .File.Dir "\\" "/") }} {{ range .Params.Images }} {{ .caption }} {{ end }} {{ else if eq (lower .Params.mode) "remote" }} {{ range .Params.Images }} {{ .caption }} {{ end }} {{ else }} {{ $basename := (replace .File.Dir "\\" "/") }} {{ $galleryFolderPath := (print "./static/" $basename) }} {{ if (fileExists $galleryFolderPath) }} {{ range readDir $galleryFolderPath }} {{ index (split .Name ".") 0 }} {{ end }} {{ else }} Make a gallery folder first. {{ end }} {{ end }}