Sample post

Sample post

Hello, world!

This is just a sample post to explore and demo features of Hugo to to the blog owner.

Modifying the site

Firstly, clone this site repository with git.

To ease creating and previewing new posts, you can install hugo on your machine and run the following command.

hugo server

This will start a local Hugo server on your machine accessible at http://localhost:1313

You can edit the files in the repository and Hugo will reload on your browser so you can preview the site as you edit it.

Creating a new post

To create a new post about reinventing the wheel, you can run the following command (while in the repository)

hugo new content content/posts/reinventing_the_wheel.adoc

Then you can start editing the AsciiDoc file you just created with your preferred text editor.

The previous way is the simplest way of creating a post, but if you think you will have some attachments in the post, or create it in multiple languages, you should probably create the post in a directory instead, as follows:

hugo new content content/posts/reinventing_the_wheel/index.adoc

This way all the files relating to that post will stay neatly in their own directory. I will expand on that in the next chapter.

File management, images, etcetera

When you have created your post as a directory, you can refer to any file in AsciiDoc with a relative path like this image (view the source code AsciiDoc file to see what I mean)

Sample image

You can also include other types of files, like code blocks like this

baseURL = 'https://blog.tolkku.net/'
languageCode = 'en-us'
title = 'Tolkku Blog'


# (Optional) If you provide a Disqus shortname, comments will be enabled on
# all pages.
# disqusShortname = "my-site"

enableGitInfo = true

Directory layout

For how you manage your files under the content directory, Hugo doesn’t really care. Everything under content is basically the root directory of your website so you can do it however you want. But I would recommend thinking about the file structure you want now before you start creating posts because changing it later will break any links you have previously shared/saved elsewhere.

You can just create your individual posts as directories under content, or you can have some kind of a hieararchical structure if you’d like. For example, you could break the posts apart by year like this.

$ tree content/posts
content/posts
├── 2024
│   └── my_post
│       └── index.adoc
└── 2025
    └── my_post_about_another_thing
        └── index.adoc

These two would be accessible under

Pushing your changes to the website

Simply just push a commit to the repo and a CI system will handle updating the website, simple as that 😉

If you want to see what the CI system is doing, you can view the runs in here.

Further reading

This document is by no means an exhaustive tutorial on how to use Hugo. The project has very good documentation and you can also ask yours truly for tips and tricks on how to do stuff.

Footnotes

You wanted to know if Hugo supports footnotes. Seems like it does. Following is a demonstration of how to use them. This is just pure AsciiDoc.

The hail-and-rainbow protocol can be initiated at five levels:

  1. double[1]

  2. tertiary

  3. supernumerary

  4. supermassive

  5. apocalyptic

A bold statement![2]

Another outrageous statement.[2]

Closing words

You should be all set now to start creating posts. Happy blogging! Contact me if you need any help.


1. The double hail-and-rainbow level makes my toes tingle.
2. Opinions are my own.