Skip to content

Creating a blog post

Hans5958 edited this page Feb 4, 2023 · 5 revisions

Here is a quick guide to create a blog post.

Creating a file

Firstly, create a file located inside the content/blog. The name of the file can be anything, but it is recommended to do name-of-the-file.md. You don't need to put dates, they are sorted automatically by Hugo, using the front matter.

Do the front matter

The basic front matter is as follows.

---
title: Post title
description: Something about the post
date: 2021-05-22T03:12:10+07:00
author: ScratchCat
---
  • title: The title of the post. It could be different from the file name. This will be displayed on the header.
  • description: The description of the post. Appears on the index and Google searches.
  • date: The date of the post. Date created is recommended. Use ISO 8601.
  • author: The author of the post.

For title, description, and author, any characters are allowed. Wrapping in double quotes is recommended, but most time you will be fine without double quotes.

Other front matter variables can be used in conjunction with these variables.

Write the post

You can just start writing in Markdown. You don't need to write the post title again, since it will be taken from the title to the header.