Iβve tried searching for solution extensively, but unfortunately I have failed to find an answer that would solve my issue.
Basically what I am trying to do is list some content on the homepage of the site along with its respective resources and I would like this content not to be listed anywhere else on the site, ie. no listing page.
Here is a visual ASCII mockup of what I am trying to achieve:
Section with listed content:
+---------+ +---------+
| img | | img |
|---------| |---------|
| Title | | Title |
| Content | | Content |
+---------+ +---------+
My content
structure is as follows:
content
|-headless
|-index.md / _index.md <-- I've tried both names
|-first
| |- index.md
| |- logo
| |- img-first.png
|-second
|- index.md
|- logo
|- img-second.png
File content/headless/index.md(_index.md)
has headless: true
set in its front-matter.
Issues I am having are:
- If opt for Branch bundle (
_index.md
) I can easily list all its child content along with their respective resources, but even withheadless
option turned on the site still tries to list content when user navigates tohttp://localhost:1313/headless
- When I try and make it a Leaf bundle (
index.md
), then theheadless
option really works and the site does not try to list the nested content, but now I donβt know how to access each pageβs resources. I used the following code to list the children:
When using Leaf bundle:
{{ $headless := .Site.GetPage "/headless" }}
{{ $pages := $headless.Resources.ByType "page" }}
{{ range $pages}}
...
don't know how to get page resources from here
{{ end }}
Is what I am trying to achieve even possible and if it is, how would one go about doing it?
One thing I would like to point out is that I donβt need the content under headless
folder to be available in some listing page nor do I need it as a single page. I just need to call it/list it on the homepage in some arbitrary section.
Any help is greatly appreciated.