Hello super fast blogging!

Exploring static site builder for quick blogging

  ยท   2 min read

Brief

Today i tried to setup static site builder called HUGO, for blogging. It comes in handy once you set up all the parameters. It is a combination of markdown + config files. With few hours of efforts was able to set it up.

Installing HUGO is very straightforward, you can find instructions for your platform here.

Main problems that one could face are:

  • version of HUGO and the reference blogs might be outdated, hence please refer to the latest docs of HUGO
  • it is worth spending sometime to go through the directory structure
  • images and paths can get pretty cumbersome, i could not setup markdown based rendering in hugo for images
  • using shortcodes for rendering images in between the content came in handy

HUGO needs some additional setup to get started with Math symbols in blogs using Katex, have attached relevant link in the references for the same.

Below are some commands to get started with HUGO.

Commands

 1# install HUGO (macOS)
 2brew install hugo
 3
 4# create HUGO site called "blog"
 5# choose format yaml
 6hugo new site blog --format yaml
 7
 8# add desired theme as submodule
 9git submodule add https://github.com/reorx/hugo-PaperModX.git themes/PaperModX
10
11# update submodule
12git submodule update --init --recursive
13
14# go to respective site directory
15cd blog
16
17# generate static website
18hugo
19
20# live rebuild server
21hugo server -D
22
23# using python http server
24python3 -m http.server -d public
25
26# before deploy
27hugo --minify
28
29# pagefind build index
30npx pagefind --site public
31
32# copy public folder to your hosting platform

References

  1. PaperModX features
  2. Adding images in HUGO is pain
  3. Math in HUGO
  4. Emoji support
  5. Using Local fonts HUGO
  6. Shortcodes super useful
  7. Setting up internal search using pagefind

Written By

Sagar Sarkale