# Split config into multiple files?

**URL:** <https://discourse.gohugo.io/t/split-config-into-multiple-files/46580>\
**Category:** support\
**Created:** [October 7, 2023, 8:29pm UTC](https://discourse.gohugo.io/t/split-config-into-multiple-files/46580 "2023-10-07T20:29:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Johno](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/johno/32/20087_2.png) [@Johno](https://discourse.gohugo.io/u/Johno)\
**Post date:** [October 7, 2023, 8:29pm UTC](https://discourse.gohugo.io/t/split-config-into-multiple-files/46580/1 "2023-10-07T20:29:31Z")

</div>

Hi everyone,  
I am working on a test site at the moment and wanted to know if it was possible to split my config file into smaller files e.g.` theme.json`, `settings.json`, `foo.json` and so on?

```auto
config
     |_ _default
         |_ theme.json
         |_ params.json
         |_ foo.json

```

I know there’s a menu.json and some reserved Hugo terms but not sure if this is possible??

I tried this but it didn’t render anything:

> **[ii.com: Compartmentalizing Hugo Settings With a config Directory](https://www.ii.com/hugo-config-directory/)**

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [October 7, 2023, 8:48pm UTC](https://discourse.gohugo.io/t/split-config-into-multiple-files/46580/2 "2023-10-07T20:48:26Z")

</div>

[https://gohugo.io/getting-started/configuration/#configuration-directory](https://gohugo.io/getting-started/configuration/#configuration-directory)

---

<div class="post-metadata">

**Author:** ![Johno](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/johno/32/20087_2.png) [@Johno](https://discourse.gohugo.io/u/Johno)\
**Post date:** [October 7, 2023, 8:55pm UTC](https://discourse.gohugo.io/t/split-config-into-multiple-files/46580/3 "2023-10-07T20:55:20Z")

</div>

thank you, I saw that but was not sure if that was the way I wanted since I don’t layout my files for development, production and so on, not sure why I when I tried to split the config file down it didn’t render as per the article I added.

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [October 7, 2023, 9:12pm UTC](https://discourse.gohugo.io/t/split-config-into-multiple-files/46580/4 "2023-10-07T21:12:14Z")

</div>

Sorry, I guess I don’t understand. What is foo.json for?

---

<div class="post-metadata">

**Author:** ![Johno](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/johno/32/20087_2.png) [@Johno](https://discourse.gohugo.io/u/Johno)\
**Post date:** [October 7, 2023, 9:18pm UTC](https://discourse.gohugo.io/t/split-config-into-multiple-files/46580/5 "2023-10-07T21:18:03Z")

</div>

sorry was me not being really clear.

So I have this stucture:

```auto
├── config/
       └── _default/
             └── config.json

```

But since my config.json file is big in size with a lot of lines of code, could it be possible to break it down into small files? So if in my config.json I have a block called foo, could I create a new` foo.json` file inside my `_default` folder and split my config file out like that?

so then I would have a file called foo.json with the following:

```auto
{
    "foo": "bar"
}

```

Make sense?

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [October 7, 2023, 10:26pm UTC](https://discourse.gohugo.io/t/split-config-into-multiple-files/46580/6 "2023-10-07T22:26:54Z")

</div>

You can split by the predefined top-level keys only.

You might consider using the data directory.
