Organize root page in content blocks

The site needs basically two pages - the root page (http://localhost:1313/) and about (http://localhost:1313/about). The root page is highly structure in several blocks, each containing text, title and certain metadata, so the new resource bundle feature with page resources should fit perfectly.

My problem is that I do not get the top level page resources without every page resource on any level below.

My content structure for testing is

content/
     about/
         index.md
         about01.md
         about02.md
     _index.md
     content01.md
     content01.md
     index.md
     someresource.txt

I’ve experimented with only _index.md, index.md and both (on both levels).

All I get with

{{ with .Resources.ByType "page" }}

in the index.html template are either no resource at all, or every page resource that exists (including about/index.md, about/about01.md,…). What I need would be only content01.md and content02.md. What I am doing wrong?

Thank’s very much to all of you!

Content page resources are only supported in what i call “leaf bundles”, i.e. the “index.md” variants. Adding those to the home page etc. wasn’t possible without breaking too much.

Ah, that makes sense. Thank you!

I’ll probably use data files then. In this case it should work as well.

Or you can use GetPage.

Thanks, that would be nice, but wouldn’t each page be as a separate HTML-file with an entry in sitemap.xml, too? That wouldn’t work in my case.

Yes…

Ok, then it will be data files. Thanks so much for your help!

This caught me out too. Just flagging for when proper docs are added, would be good to make a prominent ‘gotcha’ aside/warning.

Are there any thoughts about how content bundles might be supported for home pages in a future release? The home page is often one of the most complex pages of a site, so a prime candidate for the new bundle architecture.

1 Like

The home page is often one of the most complex pages of a site, so a prime candidate for the new bundle architecture.

Yes I agree there should be a way for the Home page to get its own bundle even if the structure looks weird.

Adding a _bundle/ directory at the root of my content/ in order for the home page to get its own bundle is a price I am willing to pay.

1 Like