🚧 How to build a free blog using Hugo

Hello. In this post we will learn how to build a free personal blog using Hugo + Github page. Have fun!

Step 2: Create a new site.

Step 3: Setup your hugo theme.

  • Find a theme from: https://themes.gohugo.io/.
  • Download theme and put into site’s themes directory. Example we want to use theme Ananke:
    1
    2
    3
    
        cd myblog
        git init
        git submodule add https://github.com/budparr/gohugo-theme-ananke.git themes/ananke
    
  • Inside file hugo.toml (or config.toml if you use old version).
    1
    2
    3
    
        ...
        theme = "ananke"
        ...
    
  • Hugo site configuration document: https://gohugo.io/getting-started/configuration/
  • Command to create new post: hugo new <POST TYPE>/<POST_TITLE.md>
    Then edit the new file.
  • 🚧 Basic markdown document: https://…
  • 🚧 Post header document: https://…
  • 🚧 About resource folders struct: https://…
  • Start hugo server

    1
    
        hugo server
    

    Default port is 1313 so you can access http://localhost:1313
    hugo help serve to see all command options

  • Build site

    1
    
        hugo
    

    Result is saved in folder public.
    hugo help to see all command options


🚧 Next article: Publish this blog using github page

Step 6: Register a new Git Hub Account.

Step 7: Create a new public repository.

Step 8: Inside repository setting, enable github pages.

Step 9: Upload folder public to repository

Step 10: Check your online site.

Bonus:

  1. Create cname record for your custom domain to github page domain.
  2. Update setting, use custom domain.
  3. Wait for a moment (sometimes to 24 hours) and check Enforce HTTPS