Technologies and Software Engineering

A Quick Guide to Hugo’s Core Directory Structure

A Hugo site is powered by five key directories: content, layouts, archetypes, static, and themes. Here’s a concise guide to what each does and why it matters.

1. Content: Your Site’s Words

Everything you publish lives in content/.

How content is structured:

Key concepts:

2. Layouts: How Everything Looks

layouts/ holds the templates that render all content.

How Hugo selects templates:

3. Archetypes: Faster Content Creation

Archetypes provide default front matter for new content.

4. Static: Your Assets

Everything in static/ is published as-is.

Common contents:

Hugo doesn’t enforce an asset pipeline—your tooling decides what ends up here.

5. Themes: Drop-In Site Designs

The themes/ directory allows you to plug in complete design packages.

Each theme typically includes its own:

Your project will use these files unless you override them in your root directories. This structure makes customizing or extending a theme straightforward while keeping project-specific changes cleanly separated.

Example of Hugo’s Core Directory Structure:

my-hugo-site/
├── archetypes/
│   ├── default.md
│   └── blog.md
├── content/
│   ├── _index.md
│   ├── about.md
│   └── blog/
│       ├── _index.md
│       └── first-post.md
├── layouts/
│   ├── _default/
│   │   ├── baseof.html
│   │   ├── list.html
│   │   └── single.html
│   └── blog/
│       └── single.html
├── static/
│   ├── css/
│   │   └── styles.css
│   ├── js/
│   │   └── main.js
│   └── images/
│       └── logo.png
├── themes/
│   └── my-theme/
│       ├── layouts/
│       ├── static/
│       ├── archetypes/
│       └── theme.toml
└── config.toml
Tags:

Search