Understanding Hugo's directory structure is essential for managing content and assets effectively.
Directory Structure
Hugo projects follow a conventional layout. Each directory has a fixed role and Hugo will not look for files outside their expected locations.
.
âââ archetypes/ # Templates for new Markdown files
âââ assets/ # Processed assets (images, CSS, JS)
âââ content/ # Markdown files
âââ data/ # Structured data (yaml, json, toml, org, csv, xml)
âââ i18n/ # Translation files
âââ layouts/ # Custom layout files
âââ static/ # Raw static files (robots.txt, CNAME, .woff2)
âââ themes/ # Theme files
âââ hugo.yaml # Site configurationThe rest of this page covers the three directories you will interact with most: assets/, static/, and content/.
Page Bundles
Hugo supports two ways to organize content files in content/.
A standalone page is a single .md file, such as content/about.md. It has no associated resources, so you cannot attach images or other files directly to the page.
A leaf bundle is a directory containing an index.md file, such as content/about/index.md. Images and other files placed in the same directory are treated as page resources, meaning the theme can use them for thumbnails, galleries, or other features.
content/
âââ awesome_article/ <-- leaf bundle
âââ index.md
âââ feature.png <-- page resource, available to the themeIf you are following this documentation, use the leaf bundle structure for all your posts.
Asset Placement: assets/ vs. static/
assets/
Hugo can process files in this directory before publishing them. For images, this means automatic resizing and format conversion (e.g. to WebP). For CSS and JS, Hugo can minify and fingerprint them. Place all images and stylesheets here.
static/
Hugo copies files in this directory to the build output as-is, without any processing. Use it for files that do not need transformation, such as robots.txt or font files.
Prefer assets/ over static/ for most files. Hugo only publishes files in assets/ that are actually referenced, and their URLs update automatically if paths change. Files in static/ are always copied to output regardless of whether they are used.
Referencing Assets in Markdown
Images in assets/
Hugo strips the assets/ prefix when publishing, so the file assets/img/logo.svg is served at /img/logo.svg. Reference it from any page using an absolute path:
Images in a Leaf Bundle
If you are using a leaf bundle, you can place images in the same directory as index.md and reference them with a relative path. This keeps the image scoped to the article and avoids polluting the global assets/ directory.
For example, with directory structure like this:
content/
âââ posts/
âââ my-article/
âââ index.md
âââ local-image.pngAnd reference them within index.md:
