Hello, I am building a simple restaurant website and I’m having issues. Basically, on my homepage I want to render a list of all the types of food from the menu. Let’s say for now that the available types of foods are burgers and salads. I used this site from the documentation in hopes of helping me, but it didn’t. Here’s what my project structure currently looks like:
- content
- burger
- first-burger
- image.jpg
- index.md
- first-burger
- burger
I would be adding the salad folder right under the burger folder. What I’m trying to do now is render a list of burgers on my homepage and display their title and their image(image.jpg).
I inserted the code from the mentioned website:
{{ range .Pages }}
<li>
<a href="{{.RelPermalink}}">{{.Title}}</a>
</li>
{{ end }}
But that just renders a link with the text Burger
and leads to http://localhost:1313/burger/
instead of http://localhost:1313/burger/first-burger
. What am I doing wrong? I tried setting permalinks, adding/changing index.md and _index.md… I tried different variables but nothing works… I mean I understand that I am looping through all Pages instead of all Burgers, but I can’t find any information on how to specifically select the Burgers leaf bundles?