{{/* Gallery Shortcode for Wowchemy. */}} {{/* Load gallery images from page dir. */}} {{/* Get album folder or default to `gallery/`. */}} {{ $album := (.Get "album") | default "gallery" }} {{/* Set image path and page bundle that images are associated with. */}} {{ $album_path := "" }} {{ $resource_page := "" }} {{ if eq .Page.Parent.Type "widget_page" }} {{ $album_path = printf "%s/%s/*" (path.Base (path.Split .Page.Path).Dir) $album }} {{ $resource_page = $.Page.Parent }} {{ else }} {{ $album_path = printf "%s/*" $album }} {{ $resource_page = $.Page }} {{ end }}