How to set up this website?

ยท 321 words ยท 2 minute read

How to (set up this website)? ๐Ÿ”—

I use a fork of the Hugo theme mini by nodejh, only becuase I want to make a few customisations. Please feel free to use either as the setup steps would be the same :)

1. Pre-requisites ๐Ÿ”—

Please ensure you have hugo installed on your system. If not, you may follow the installation instruction here.

2. Setup ๐Ÿ”—

  • Create an empty repo and clone it
git clone https://github.com/<your username>/<your repo>.git
  • Navigate to your cloned repo and install the theme as a submodule. You might have to replace deutranium with nodejh depending on which theme you’re using.
git submodule add https://github.com/deutranium/hugo-theme-mini.git themes/mini
  • Now that we have the theme in place, we need to create the directory structure to store out content.
  • Simply copy the exampleSite provided with the theme itself
cp -r ./themes/mini/exampleSite/ ./

2.2 Create directory structure from scratch ๐Ÿ”—

  • Use a bunch of mkdir and touch statements to create the following directory structure:
.
โ”œโ”€โ”€ LICENSE
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ config.yaml
โ”œโ”€โ”€ content
โ”‚ย ย  โ”œโ”€โ”€ about
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ _index.md
โ”‚ย ย  โ””โ”€โ”€ blog (add this only if you're using `deutranium/` fork of the theme)
โ”‚ย ย      โ””โ”€โ”€ _index_.md
โ”‚ย ย  โ””โ”€โ”€ posts
โ”‚ย ย      โ””โ”€โ”€ test.md
โ”œโ”€โ”€ layout
โ””โ”€โ”€ static

Recall that mkdir <folder name> and touch <file name> create the folders and files with the respective names.

3. Run the server ๐Ÿ”—

  • Simply run the server from your project root using
hugo server

and you should be able to see your website at the URL shown in your terminal window (Probably http://localhost:1313/about/)

Please note that the website would have some palceholder content if you followed 2.1, and empty otherwise.

4. Enjoy :) ๐Ÿ”—

Have some cold lemonade or hot chocolate depending on the how cold/hot it is outside your window!

5. (Optional) Deploy on Github Pages ๐Ÿ”—

Check out this wonderful tutorial by Hugo: Host on Github Pages