How to Create a Personal Website With Hugo

Prerequisites

  1. Install Hugo
  2. Install Git

Create a site

Run these commands to create a Hugo site with the hugo-theme-stack theme. The next section provides an explanation of each command.

1
2
3
4
5
hugo new site quickstart
cd quickstart
git init
git submodule add https://github.com/CaiJimmy/hugo-theme-stack/ themes/hugo-theme-stack
echo "theme = 'hugo-theme-stack'" >> hugo.toml

Add line numbers to a code block

1
2
3
4
# ./quickstart/hugo.toml
[markup]
  [markup.highlight]
    lineNos = true

Add line numbers

Add content

Add a new page to your site.

1
hugo new content post/my-first-post.md