# How all collections inside one subdirectory works?

**URL:** <https://talk.jekyllrb.com/t/how-all-collections-inside-one-subdirectory-works/1034>\
**Category:** Uncategorized\
**Created:** [October 1, 2017, 9:04pm UTC](https://talk.jekyllrb.com/t/how-all-collections-inside-one-subdirectory-works/1034 "2017-10-01T21:04:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hnaseri](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/hnaseri/32/831_2.png) [@hnaseri](https://talk.jekyllrb.com/u/hnaseri)\
**Post date:** [October 1, 2017, 9:04pm UTC](https://talk.jekyllrb.com/t/how-all-collections-inside-one-subdirectory-works/1034/1 "2017-10-01T21:04:11Z")

</div>

As suggested [here](https://github.com/jekyll/jekyll/pull/6331), I want to use all my collections inside a subdirectory. I wanted to test this feature by putting this inside my \_config.yml file:

```auto
collections:
  collections_dir: mycollections
  output: true
  permalink: /:name

```

then I have `mycollections` subdirectory as follows:

```auto
mycollections
...._book
........sample.md

```

However this file isn’t rendered in my jekyll.

---

<div class="post-metadata">

**Author:** ![mmistakes](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/mmistakes/32/2169_2.png) [@mmistakes](https://talk.jekyllrb.com/u/mmistakes)\
**Post date:** [October 1, 2017, 10:34pm UTC](https://talk.jekyllrb.com/t/how-all-collections-inside-one-subdirectory-works/1034/2 "2017-10-01T22:34:03Z")

</div>

What does the rest of your collection configuration look like? What you have above isn’t enough.

My understanding is all `collections_dir` is allowing you to do is to place all your collections in a subfolder. So instead of:

```auto
my-project/
├── _collection1/
│ ├── some-file.md
│ └── another-file.md
├── _collection2/
│ ├── 2-some-file.md
│ └── 2-another-file.md
├── _collection3/
│ ├── 3-some-file.md
│ └── 3-another-file.md

```

You can clean things up with:

```auto
my-project/
├── mycollections/
│ ├── _collection1/
│ │ ├── some-file.md
│ │ └── another-file.md
│ ├── _collection2/
│ │ ├── 2-some-file.md
│ │ └── 2-another-file.md
│ ├── _collection3/
│ │ ├── 3-some-file.md
│ │ └── 3-another-file.md

```

That said you still need to configure each collection as you normally would by setting each to `output: true` and whatever permalinks you want. What you have above looks to be trying to apply a default config to all collections, which I don’t think Jekyll currently supports.

```auto
collections:
  collections_dir: mycollections
  collection1:
    output: true
    permalink: /:name
  collection2:
    output: true
    permalink: /:name
  collection3:
    output: true
    permalink: /:name 

```

---

<div class="post-metadata">

**Author:** ![hnaseri](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/hnaseri/32/831_2.png) [@hnaseri](https://talk.jekyllrb.com/u/hnaseri)\
**Post date:** [October 2, 2017, 6:14am UTC](https://talk.jekyllrb.com/t/how-all-collections-inside-one-subdirectory-works/1034/3 "2017-10-02T06:14:59Z")

</div>

Ok so I changed my \_config.yml to the following

```auto
collections:
  collections_dir: mycollections
  book:
    output: true
    permalink: /:name

```

but still my collections aren’t rendered. The interesting part is that if I remove `_` from `_book`, the markdown files are treated normally like a page. So I think the `collections_dir` isn’t configured properly yet? 🤔

Have you already used this feature successfully? If not I think maybe there is a bug out there.

---

<div class="post-metadata">

**Author:** ![mmistakes](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/mmistakes/32/2169_2.png) [@mmistakes](https://talk.jekyllrb.com/u/mmistakes)\
**Post date:** [October 2, 2017, 10:52am UTC](https://talk.jekyllrb.com/t/how-all-collections-inside-one-subdirectory-works/1034/4 "2017-10-02T10:52:25Z")

</div>

Nope. Haven’t used `collections_dir` yet. Seeing how it’s not officially released wouldn’t surprise me if there’s issues with it.

Your best bet is to file a ticket on jekyll/jekyll.

---

<div class="post-metadata">

**Author:** ![ashmaroli](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@ashmaroli](https://talk.jekyllrb.com/u/ashmaroli)\
**Post date:** [October 2, 2017, 6:18pm UTC](https://talk.jekyllrb.com/t/how-all-collections-inside-one-subdirectory-works/1034/5 "2017-10-02T18:18:04Z")

</div>

I think there’s an error in the official docs… from the souce code it looks like `collections_dir` is a top-level key instead of being nested within `collections` object…  
So, **if your `Gemfile` is pointed towards the jekyll repo `master`** , then change your config file to following and try again…

```auto
collections_dir: mycollections
collections:
  collection1:
    output: true
    permalink: /:name
  collection2:
    output: true
    permalink: /:name
  collection3:
    output: true
    permalink: /:name 

```

---

<div class="post-metadata">

**Author:** ![hnaseri](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/hnaseri/32/831_2.png) [@hnaseri](https://talk.jekyllrb.com/u/hnaseri)\
**Post date:** [October 2, 2017, 8:04pm UTC](https://talk.jekyllrb.com/t/how-all-collections-inside-one-subdirectory-works/1034/6 "2017-10-02T20:04:58Z")

</div>

> [@ashmaroli](#):
>
> from the souce code it looks like collections\_dir is a top-level key instead of being nested within collections object…

Yes. Thank you very much for your help.
