Organizing Content#
Learn how to effectively organize your blog content.
Directory Structure#
hugo-book theme uses a hierarchical directory structure:
content.en/
├── docs/
│ ├── _index.md # Section main page
│ ├── getting-started.md
│ ├── tutorials/ # Sub-section
│ │ ├── _index.md
│ │ ├── tutorial-1.md
│ │ └── tutorial-2.md
│ └── guides/
│ ├── _index.md
│ └── guide-1.md
└── posts/ # Blog posts
├── _index.md
└── 2025-01-01-my-post.mdCategories and Tags#
Hugo supports categories and tags through the Taxonomy system.
Adding to Front Matter#
---
title: "Post Title"
categories: ["Tutorial", "Development"]
tags: ["hugo", "go", "web-development"]
---hugo.toml Configuration#
To enable categories and tags:
# hugo.toml
[taxonomies]
category = 'categories'
tag = 'tags'Note: hugo-book theme disables taxonomies by default, so you need to enable them in configuration.
Taxonomy Pages#
Hugo automatically generates these pages:
/categories/- List of all categories/categories/tutorial/- Posts in “Tutorial” category/tags/- List of all tags/tags/hugo/- Posts with “hugo” tag
Menu Configuration#
Auto Menu (File Tree)#
hugo-book automatically generates sidebar menu from content.en/docs/ directory structure.
Adjust menu order with weight:
---
title: "First Document"
weight: 1 # Lower value appears higher
---Section Configuration#
Control section behavior in _index.md:
---
title: "Tutorials"
weight: 10
bookFlatSection: false # Display sub-items flat
bookCollapseSection: true # Collapsed by default
---Custom Menu#
Define menu manually in hugo.toml:
[[menu.before]]
name = "Home"
url = "/"
weight = 1
[[menu.after]]
name = "GitHub"
url = "https://github.com/yourusername"
weight = 10Hiding Pages#
Hide specific pages from menu:
---
title: "Hidden Page"
bookHidden: true
---Exclude from Search#
Exclude pages from search results:
---
title: "Search Excluded Page"
bookSearchExclude: true
---Multi-language Content Organization#
Separation by Directory (Current Setup)#
content.ko/ # Korean content
docs/
getting-started.md
content.en/ # English content
docs/
getting-started.mdSeparation by Filename (Alternative)#
content/
docs/
getting-started.ko.md
getting-started.en.mdTranslation Linking#
To link multi-language versions of the same content, maintain identical file structure:
content.ko/docs/tutorial.md
content.en/docs/tutorial.mdHugo automatically generates language switcher links.
Static Files Organization#
Images#
static/
images/
2025/
01/
photo.jpgUsage:
Download Files#
static/
downloads/
document.pdfLink:
[Download PDF](/downloads/document.pdf)Language-specific Static Files#
static/
ko/
images/
banner.jpg
en/
images/
banner.jpgArchive Organization#
By Date#
content.en/
posts/
2025/
01/
post-1.md
post-2.mdBy Topic#
content.en/
docs/
backend/
_index.md
django.md
fastapi.md
frontend/
_index.md
react.md
vue.mdFront Matter Templates#
Use archetypes for consistent metadata:
archetypes/docs.md#
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
weight: 10
bookToc: true
categories: []
tags: []
---Create new post:
hugo new --kind docs content.en/docs/my-post.mdOrganization Tips#
- Maintain Consistent Structure: Use identical directory structure across all languages
- Weight System: Use increments like 10, 20, 30… for easy insertion later
- Naming Convention: Use lowercase and hyphens for filenames (e.g.,
my-post.md) - Use Sections: Group related documents into sections
- Optimize for Search: Include important keywords in titles and descriptions
- Use ToC: Enable
bookToc: truefor long documents to improve readability