Hello,
I’m trying to set up a personal travel blog/diary/gallery. In every page I’d like to have a structure like:
So, for every part of the trip I’m showing a map with the markers from exif data, then some content, then the pictures - all in a single page.
The screenshot comes from my first attempt to do it by abusing of bundles:
content/
trips/
ireland/_index.md <- whole trip
day_1/_index.md <- first day - this will get rendered in one page
road-trip/index.md <- leaf bundle - first part of the page
media/ *.jpg <- media for the part
inis-mor/index.md <- leaf bundle - second part of the page
media/ *.jpg <- media for the second part
day_2/_index.md <- second page
...
I used just a layouts/trips/section.html
to render everything: Title and description of each part come from the leaf index.html
, while the pictures and maps are based on the leaf bundle resources.
Now, with this approach I cannot get navigation to work - in the context of day_1
and day_2
.Prev
and .Next
are undefined, while .Site.RegularPages.Next/Prev
point to inner pages, and not to the siblings of the sections. I have a hunch I could traverse the tree recursively as shown in the breadcrumb example, and some posts here did hint at that direction. However, this seems to get overly complicated.
I also tried to write a shortcode to generate each part, taking a subdirectory as input and using Resources.Match to load only those resources - but then I must mention each subdir individually in each index.md
. The previous approach was way more automated. Of course I could use an external script to generate the pages, but I’d rather not.
So, to come to my question: Can someone point me to a clean and lean way to build a page by scanning automatically some resources grouped by directory? The groups should also respect some ordering - date or some ancillary field, but content of day 2 should definitely come after day 1.
Thanks!