Writing Posts#
Learn how to create new posts in Hugo.
Creating a New Post#
Use the Hugo CLI to generate a new post:
# Create Korean post
hugo new content.ko/docs/my-first-post.md
# Create English post
hugo new content.en/docs/my-first-post.mdFront Matter Configuration#
Each post has Front Matter at the top defining metadata.
Basic Configuration#
---
title: "Post Title"
date: 2025-12-19T20:00:00+09:00
weight: 10
bookToc: true
---Main Front Matter Options#
| Option | Description | Example |
|---|---|---|
title |
Post title | “Getting Started with Hugo” |
date |
Publication date | 2025-12-19T20:00:00+09:00 |
weight |
Menu order (lower = higher) | 10 |
bookToc |
Show table of contents | true/false |
bookHidden |
Hide from menu | true/false |
bookFlatSection |
Display section flat | true/false |
bookCollapseSection |
Collapse section | true/false |
Custom Metadata#
Additional metadata for search and SEO:
---
title: "Post Title"
description: "Brief description of the post"
tags: ["hugo", "blog", "web-development"]
categories: ["Tutorial"]
author: "Author Name"
---Writing Markdown#
Hugo supports standard Markdown and extended features.
Headings#
# H1 Heading
## H2 Heading
### H3 HeadingText Styles#
**Bold**
*Italic*
~~Strikethrough~~
`Inline code`Links and Images#
[Link text](https://example.com)
Code Blocks#
```python
def hello():
print("Hello, Hugo!")
```Lists#
- Item 1
- Item 2
- Sub-item
1. Ordered item 1
2. Ordered item 2Blockquotes#
> Quote contentTables#
| Column1 | Column2 |
|---------|---------|
| Content1 | Content2 |hugo-book Shortcodes#
hugo-book theme provides useful shortcodes.
Hints (Notice Boxes)#
{{< hint info >}}
Info message
{{< /hint >}}
{{< hint warning >}}
Warning message
{{< /hint >}}
{{< hint danger >}}
Danger message
{{< /hint >}}Buttons#
{{< button relref="/" >}}Home{{< /button >}}
{{< button href="https://example.com" >}}External Link{{< /button >}}Columns#
{{< columns >}}
## Left Column
Content...
<--->
## Right Column
Content...
{{< /columns >}}Tabs#
{{< tabs "unique-id" >}}
{{< tab "Tab1" >}} Tab1 content {{< /tab >}}
{{< tab "Tab2" >}} Tab2 content {{< /tab >}}
{{< /tabs >}}Details (Collapse/Expand)#
{{< details "Title" >}}
Expandable content
{{< /details >}}Image Management#
Store images in the static directory:
static/
images/
photo.jpg
logo.pngReference in markdown:
Draft Mode#
Mark posts as draft while writing:
---
title: "Work in Progress"
draft: true
---Run server with drafts:
hugo server --buildDraftsPreview Posts#
Preview locally:
hugo serverVisit http://localhost:1313 in your browser
Tips#
- Use Weight: Adjust post order with weight values
- Enable ToC: Use
bookToc: truefor long documents - Use Shortcodes: Create rich content with hugo-book shortcodes
- Optimize Images: Use appropriately sized images
- Internal Links: Use
relrefshortcode for safe internal linking