點燈坊

失くすものさえない今が強くなるチャンスよ

Congo Theme Overview

Sam Xiao's Avatar 2022-12-19

Install Congo theme with the default configuration and the example site. Congo theme is built with TailwindCSS 3.2.

Version

Hugo 0.108

Create New Site

$ hugo new site my-congo
  • hugo new site : create a new site with a default skeleton

Create NPM Config

$ cd my-congo
$ npm init -y

Create an empty NPM config.

NPM Config

package.json

{
  "name": "my-congo",
  "version": "1.0.0",
  "license": "MIT",
  "scripts": {
    "dev": "hugo server",
    "build": "hugo --minify"
  }
}

Line 5

"scripts": {
  "dev": "hugo server",
  "build": "hugo --minify"
}
  • dev : run web server under development mode
  • build : build HTML/CSS/JavaScript under production mode

Add .gitignore to ignore these files by Git.

Install Congo Theme

$ git init
$ git submodule add https://github.com/alex-shpak/hugo-book themes/hugo-book
  • git init:create a new git respository
  • git submodule add:install the Hogo Book theme as a git submodule

Hugo Config

$ cp themes/congo/config/_default/config.toml .

Copy the default config.toml provided by Congo theme.

Run Example Site

$ cd themes/congo
$ npm run example

Run example site provided by Congo theme.

Conclusion

  • Install a Hugo theme as a git submodule to let the theme be updatable in the future
  • Congo theme provides an example under exampleSite folder

Reference

Congo, Installation