# Listing pages within a subdirectory

**URL:** <https://zola.discourse.group/t/listing-pages-within-a-subdirectory/2424>\
**Category:** Support\
**Created:** [December 26, 2024, 5:33pm UTC](https://zola.discourse.group/t/listing-pages-within-a-subdirectory/2424 "2024-12-26T17:33:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vivam](https://avatars.discourse-cdn.com/v4/letter/v/edb3f5/32.png) [@vivam](https://zola.discourse.group/u/vivam)\
**Post date:** [December 26, 2024, 5:33pm UTC](https://zola.discourse.group/t/listing-pages-within-a-subdirectory/2424/1 "2024-12-26T17:33:12Z")

</div>

I’m trying to port my blog from Hugo to Zola and I’m having trouble.

If I have a subfolder like `content/posts` and intend to use that for articles, how do I dynamically list the articles in that folder? The documentation shows iterating `section.pages` and mentions that sub-directories without an `_index.md` will create orphaned pages. Are sections the only way to iterate the content of folders? What if I don’t want `/posts/` to be a public directory? It’s purely for organising the content of my source folder.

Also, is there any way to dump what is in scope of the evaluator for the template language? I don’t know how you work with esolangs when it’s non-obvious how you work out which functions exist and which variables are in scope. Things like `section.pages` are completely opaque to me. I’ve worked out that you can dump them with `json_encode()` but I’d really like to see if there’s any way to refer to these orphaned pages or organise them without creating a public route named after their containing folder. It’s really difficult for me to tie things together when it feels like guesswork to do anything.

Any help would be much appreciated, thank you.

---

<div class="post-metadata">

**Author:** ![vivam](https://avatars.discourse-cdn.com/v4/letter/v/edb3f5/32.png) [@vivam](https://zola.discourse.group/u/vivam)\
**Post date:** [December 26, 2024, 6:16pm UTC](https://zola.discourse.group/t/listing-pages-within-a-subdirectory/2424/2 "2024-12-26T18:16:49Z")

</div>

Turns out I have a skill issue and could’ve used `get_section(path="posts/_index.md")` the entire time. Still, the docs could be improved in this way. The docs explicitly mention such a folder structure with separate sections but no real example (as far as I recall).

I’m still interested to know if there’s a more interactive way to work with the templating language - if I didn’t have access to this forum, I’d be unable to get anywhere.
