Organize Files
Directory Structure
- _index.md
- .gitignore
- LICENSE
- Makefile
- README.md
- vanityURLS.conf
-
- _headers
-
- lnk
- validateURL
ℹ️
It is recommended to keep the sidebar not too deep. If you have a lot of content, consider splitting them into multiple sections.
Each of the _index.md
files is the index page for the corresponding section. The other Markdown files are regular pages.
content
├── _index.md // <- /
├── docs
│ ├── _index.md // <- /docs/
│ ├── getting-started.md // <- /docs/getting-started/
│ └── guide
│ ├── _index.md // <- /docs/guide/
│ └── organize-files.md // <- /docs/guide/organize-files/
└── blog
├── _index.md // <- /blog/
└── post-1.md // <- /blog/post-1/
Layouts
Hextra offers three layouts for different content types:
Layout | Directory | Features |
---|---|---|
docs |
content/docs/ |
Ideal for structured documentation, same as this section. |
blog |
content/blog/ |
For blog postings, with both listing and detailed article views. |
default |
All other directories | Single-page article view without sidebar. |
To customize a section to mirror the behavior of a built-in layout, specify the desired type in the front matter of the section’s _index.md
.
content/my-docs/_index.md
---
title: My Docs
cascade:
type: docs
---
The above example configuration ensures that the content files inside content/my-docs/
will be treated as documentation (docs
type) by default.
Sidebar Navigation
The sidebar navigation is generated automatically based on the content organization alphabetically. To manually configure the sidebar order, we can use the weight
parameter in the front matter of the Markdown files.
content/docs/guide/_index.md
---
title: Guide
weight: 2
---