In Hugo, project structure and naming is fairly rigid other than content structure. You must follow the Hugo guidelines for where content, layouts, data, and static assets must be stored.
Inside your content folder, you create the structure and organization that works for you.
For example, a Hugo site may look like this:
. ├── archetypes/ ├── config.yml ├── data/ | └── members.yml ├── layouts/ | ├── footer.html | └── header.html ├── content/ | ├── 2007-10-29-why-every-programmer-should-play-nethack.md | └── _index.md ├── public/ ├── static/ | ├── screen.css | └── main.js ├── themes/ | └── example-theme
For a full breakdown on how this directory structure works, see the Hugo docs.
How Forestry Parses Hugo
Based on the example structure above, let’s explain how Forestry parses your site.
Forestry parses the
content/ folder for any applicable content.
Any content in the root of the content folder with be added to the “Pages” content type.
Any content in a subfolder will be added to a content type with the same name as that folder. For example,
content/posts/ would become the “Posts” content type.
Any files found inside the
_data/ folder are parsed as data files and are displayed individually in the CMS under the “Data” section.
Front Matter Templates
We will also parse the Archetypes of your theme folder when importing your site.
- Hugo Structure Reference
- Hugo Sections Reference
- Hugo Content Types Reference
- Hugo Archetypes Reference
Caught a mistake or want to contribute to the docs? Edit this page on Github!