Have index.md pass child pages up (transparency)

Hi, I have three sub-folders in content/ that I wish to have their own landing pages, while still passing up their sub pages to the main index. I want every post paginated at root, regardless of the section it came from.

Right now that is accomplished with having pages in each subfolder that organize all the other posts. There are a couple issues with that:

  1. The landing pages have their own names, e.g. root/subfolder/landing, when they should really be at root/subfolder.
  2. The landing pages do not have access to the section’s child pages or other variables accessible to index.md and _index.md. Therefore I am organizing the other pages manually, which is not practical long-term.

If I have an _index.md file, I can set transparent = true and pass the child pages up to root – but I don’t get a landing page for each subsection.

If I have an index.md file, I get the subsection landing page, but setting transparent = true has no effect and the child pages aren’t visible at root.

Is there a way to combine the landing page, transparency, and section variables into one page?

OK so here’s a confusing thing about the Section docs

# This determines whether to redirect when a user lands on the section. Defaults to not being set.
# Useful for the same reason as `render` but when you don't want a 404 when
# landing on the root section page.
# Example: redirect_to = "documentation/content/overview"
redirect_to = ""

“” is not the default value. “” redirects to your root address endlessly. Which is only slightly less frustrating than redirection to Rick Astley’s 1987 smash hit, “Never Gonna Give You Up”. Docs should definitely be changed to simply redirect_to = or something along those lines that make it clear, redirecting to your root address + a blank string will be a bad time.

I’m also still confused about _index vs. index but sometimes when a thing starts working you know better than to ask questions. And the radio plays on.

Yeah sorry about the confusion, the default for redirect_to is unset but I wasn’t sure how to represent it in the code block :confused:
I’ll change it to something else.

_index.md -> is a section, index.md is nothing particular in Zola.

1 Like