Technically, you have two config
files because you want Hugo to create two sites, with each site configured to use a different theme.
Some few background information you need to understand:
- Read docs here: https://gohugo.io/getting-started/configuration/
- Hugo (by default) generates your site into a
public/
directory. Whatever is inpublic/
is what becomes your website. You can tell Hugo to generate your site into a different directory instead, such asotherpublicdir/
by configuring thepublishDir
- You can have multiple config files in your project, and specify to Hugo which one to use to generate your site.
So, you could have this site layout for example:
.
├── config-notes.toml
├── config.toml
├── content
│ ├── _index.md
│ ├── main1.md
│ ├── main2.md
│ ├── main3.md
│ └── notes
│ ├── post1.md
│ └── post2.md
├── layouts
├── public
├── static
└── themes
├── main
│ ├── layouts
│ │ ...
│ └── theme.toml
└── notes
├── layouts
│ ...
└── theme.toml
Then in your main config.toml
file:
baseURL = "http://example.org/"
languageCode = "en-us"
title = "My Main Hugo Site"
theme = "main"
and in your config-notes.toml
file:
baseURL = "http://example.org/notes/"
languageCode = "en-us"
title = "My Notes"
theme = "notes"
contentDir = "content/notes"
publishDir = "public/notes"
staticDir = "static/notes"
When you run hugo
, Hugo will use the config.toml
file.
When you run hugo --config=config-notes.toml
it will use the specified file.