Mixing Both Models
The two storage models are not alternatives you must choose between site-wide. They coexist freely in the same content tree, and mixing them is the expected mode of operation for sites that grow organically: a media-rich home page as a folder, a long tail of text pages as flat files.
Both models produce the same Page struct internally. Hierarchy, collections,
taxonomy, feeds, and static builds all work identically regardless of how a page
is stored – the storage model is an authoring convenience, invisible to the
rest of the engine.
A mixed tree
content/
01.home/
default.md # folder page -> /home
hero.jpg # page-local media
_hero/
default.md # page module
02.blog/
default.md # folder page -> /blog
01.first-post/
default.md # folder page -> /blog/first-post
changelog.md # file page -> /changelog
error/
404.md # file page -> /error/404
All of these load correctly. The hierarchy sees /home, /blog, /changelog,
and /error as children of /. A page loaded from 01.home/default.md and one
loaded from changelog.md are indistinguishable once parsed.
The same task in each model
The models differ only in where a page’s parts live. The table below maps the three everyday authoring tasks across both:
| Task | Folder page | File page |
|---|---|---|
| Create a page | content/01.about/default.md | content/about.md |
| Attach media | drop the file beside the index (01.about/team.jpg) | put it in a companion directory (about/team.jpg) |
| Add a module | _-prefixed subdirectory (01.about/_team/default.md) | module file or directory in the companion folder (about/_team.md) |
| Set sort order | numeric prefix on the directory (01.about/) | numeric prefix on the file (01.about.md) or menu.order |
Full details live in the Folder Pages and File Pages guides.
Avoiding collisions
A folder page and a file page can resolve to the same URL. If both
about/default.md and about.md exist in the same directory, they both map to
/about. When that happens the scanner logs a warning and keeps the file that
sorts later alphabetically; the other is dropped.
This is never something you want by accident. Pick one form per URL slug:
- Use
about.mdorabout/default.md, not both. - If a page needs to grow from a flat file into a folder (because it gained
media or modules), convert it – move
about.mdtoabout/default.mdand delete the original – rather than leaving both in place.
Choosing per page
A useful rule of thumb:
- Reach for a folder page when a page owns assets or is composed of modules.
- Reach for a file page when a page is just text.
Consistency still helps authors predict where things live, so many sites lean on one model and use the other only where it clearly pays off. See Choosing a Model in the chapter overview for the full decision guidance.