Skip to main content

Setting up Hugo & Congo

·2 mins

I mainly follow the steps in the Congo theme installation document to setup and configure the site. I also refer to Hugo Getting started document.

Here are the main steps I have taken to set up this site. You will need git and hugo ready. I installed Hugo with homebrew.

  1. Initialize a local repository to work on
    # Create a base hugo directory structure
    hugo new site my-site
    # Initialize it as a git repository
    cd my-site
    git init
    
  2. Install Congo theme as git submodule
    # Install theme data to themes/congo
    git submodule add -b stable https://github.com/jpanther/congo.git themes/congo
    
  3. Copy the default configuration files from themes/congo/config/_default into config/_default for customization.
    mkdir config
    cp -r themes/congo/config/_default config
    
  4. Add a new line: theme="congo" to the config/_default/hugo.toml file to use Congo theme
  5. Start local server and visit http://localhost:1313/
    hugo server
    
    If you see something like this, you are good to go.
    initial congo screenshot
    Initial view of a Hugo-Congo site

Some Tips #

  1. Site configurations are in config/_default/ folder:
    • hugo.toml: basic setting
    • language.en.toml: site title and author information
    • menu.en.toml: navigation bar items
    • params.toml: customize site appearance such as color scheme, article information
    • taxonomies.toml: enable tags for example by adding a line tags = 'tags' to this file
  2. Write your posts and pages in the content/ folder
    • Hugo is a static site generator and the content directory is like the root of your site.
    • A post can be a single markdown file or a bundle where you put a index.md and associated assets images together under a directory.
    • Read more about Page bundle here.
  3. Site favicon goes to the static/ folder
  4. Hugo builds generate your web site into the public folder
    • You should not use this folder.