# Support subfolder colocation for sections

**URL:** <https://zola.discourse.group/t/support-subfolder-colocation-for-sections/2150>\
**Category:** Feature requests\
**Created:** [May 30, 2024, 4:15am UTC](https://zola.discourse.group/t/support-subfolder-colocation-for-sections/2150 "2024-05-30T04:15:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![eberkund](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/eberkund/32/1228_2.png) [@eberkund](https://zola.discourse.group/u/eberkund)\
**Post date:** [May 30, 2024, 4:15am UTC](https://zola.discourse.group/t/support-subfolder-colocation-for-sections/2150/1 "2024-05-30T04:15:48Z")

</div>

Currently if I have a section (root section or otherwise) like so:

```plaintext
content
├── _index.md
├── file1.svg
└── mysubfolder
    └── file2.svg

```

And I check which assets are included in that section with the following code:

```plaintext
{% for asset in section.assets %}
<li>{{ asset }}</li>
{% endfor %}

```

It produces the following:

- `file1.svg`

But I expect it to produce:

- `file1.svg`
- `mysubfolder/file2.svg`

Is there anything preventing adding this behaviour?

I think this behaviour is what most people would expect given that **Zola already supports asset colocation subfolders for pages**. It would be more consistent if they were also supported for sections.

---

<div class="post-metadata">

**Author:** ![keats](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@keats](https://zola.discourse.group/u/keats)\
**Post date:** [May 31, 2024, 10:14am UTC](https://zola.discourse.group/t/support-subfolder-colocation-for-sections/2150/2 "2024-05-31T10:14:02Z")

</div>

Yes it’s a feature we want but is tricky to decide _how_ it should look like. It’s definitely going to be added later though.

---

<div class="post-metadata">

**Author:** ![eberkund](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/eberkund/32/1228_2.png) [@eberkund](https://zola.discourse.group/u/eberkund)\
**Post date:** [May 31, 2024, 3:27pm UTC](https://zola.discourse.group/t/support-subfolder-colocation-for-sections/2150/3 "2024-05-31T15:27:00Z")

</div>

Glad to hear it, thanks for the response. Is there another thread somewhere that I can read up on the discussion?

I imagine the problem is the logic which decides whether a folder is a page, section or just a folder of colocated assets?

---

<div class="post-metadata">

**Author:** ![RedstoneParadox](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/redstoneparadox/32/1196_2.png) [@RedstoneParadox](https://zola.discourse.group/u/RedstoneParadox)\
**Post date:** [June 1, 2024, 7:21pm UTC](https://zola.discourse.group/t/support-subfolder-colocation-for-sections/2150/4 "2024-06-01T19:21:55Z")

</div>

I image that would be pretty easy, though. A folder with a section has a `_index.md` file, a page folder has an `index.md` file (without the underscore), and a folder with just assets has neither.

---

<div class="post-metadata">

**Author:** ![keats](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@keats](https://zola.discourse.group/u/keats)\
**Post date:** [June 2, 2024, 6:04am UTC](https://zola.discourse.group/t/support-subfolder-colocation-for-sections/2150/5 "2024-06-02T06:04:31Z")

</div>

> [@RedstoneParadox](#):
>
> A folder with a section has a `_index.md` file

How do you differentiate it from a subsection?

---

<div class="post-metadata">

**Author:** ![eberkund](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/eberkund/32/1228_2.png) [@eberkund](https://zola.discourse.group/u/eberkund)\
**Post date:** [June 2, 2024, 8:10pm UTC](https://zola.discourse.group/t/support-subfolder-colocation-for-sections/2150/6 "2024-06-02T20:10:46Z")

</div>

I am confused – are you able to provide an example of a folder structure that would be ambiguous @keats? I am sure it would be obvious once pointed out but I’m struggling to wrap my head around this.

```plaintext
content (root section which contains home)
├── _index.md
├── file1.svg
└── foo
    └── file2.svg
    └── bar (treated as page)
        └── index.md
        └── baz (subfolder of assets because pages cannot contain sections)
    └── qux
        └── my_orphan_post.md
    └── fruits (section)
        └── _index.md
        └── banana (page)
            └── index.md
        └── citrus (subsection)
            └── _index.md
        └── pictures (asset folder)
            └── img1.jpeg

```
