Skip to main content
  1. 🔰Posts/

Installing Hugo with Congo

·778 words·4 mins

The world’s fastest framework for building websites. #

Hugo is one of the most popular open-source static site generators. With its amazing speed and flexibility, Hugo makes building websites fun again.

📺 YouTube Tutorial #

💡Extensive but exceptionally good Hugo Static Site Generation Tutorial

1. Create site with Hugo #

cd "C:\Git"
hugo new site rtdevx.github.io

👨🏻‍💻Hugo framework and Git must be installed on the local system. For more details, visit: gohugo.io/installation and official Hugo website for more information.

💡Install Hugo extended with Winget on Windows:

winget install -e --id Hugo.Hugo.Extended

2. Installing Congo theme as Git submodule #

cd rtdevx.github.io
git init
git submodule add -b stable https://github.com/jpanther/congo.git themes/congo

Source: https://jpanther.github.io/congo/docs/installation/#install-using-git

ℹ️ Other options available, check: https://jpanther.github.io/congo/docs/installation/#installation

3. Set up the theme configuration files #

In the root folder of your website, delete the hugo.toml file that was generated by Hugo. Copy the *.toml config files from the theme into your config/_default/ folder. This will ensure you have all the correct theme settings and will enable you to easily customize the theme to your needs.

Remove-Item hugo.toml
New-Item -ItemType Directory -Path ./config/_default -Force
Copy-Item themes/congo/config/_default/*.toml ./config/_default


# Check if files are copied
ls .\config\_default\

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a---l       17/08/2025     21:59            560 hugo.toml
-a---l       17/08/2025     21:59           3038 languages.en.toml
-a---l       17/08/2025     21:59            217 markup.toml
-a---l       17/08/2025     21:59           1126 menus.en.toml
-a---l       17/08/2025     21:59             52 module.toml
-a---l       17/08/2025     21:59           2185 params.toml

Source: Set up the theme configuration files.

4. Update hugo.toml #

‼️If you haven’t use Hugo Modules to install Congo, you must add the line theme = "congo" to the top of your hugo.toml file.

code .\config\_default\hugo.toml

# Add line on top of the file:
theme = "congo"

ℹ️ You should also make any other modifications as appropriate (baseURL at the minimum)

📄 .\config\_default\hugo.toml

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# -- Site Configuration --
# Refer to the theme docs for more details about each of these parameters.
# https://jpanther.github.io/congo/docs/getting-started/

theme = "congo"

baseURL = "https://rtdevx.github.io/"
defaultContentLanguage = "en"

enableRobotsTXT = false
summaryLength = 0

[pagination]
  pagerSize = 10

[outputs]
  home = ["HTML", "RSS", "JSON"]

[privacy]
  [privacy.vimeo]
    enableDNT = true
  [privacy.x]
    enableDNT = true
  [privacy.youTube]
    privacyEnhanced = true

[services]
  [services.x]
    disableInlineCSS = true

5. Test new website #

hugo server -D -disableFastRender

ℹ️ After Hugo server is started, website should be available under:

http://localhost:1313/

6. The basic Congo installation is now complete. #

Continue to the Getting Started section to learn more about configuring the theme.

  • Modify languages.en.toml for English language support (other languages can be configured separately if required)
code .\config\_default\languages.en.toml
  • Change the color scheme and adjust other parameters as adequate
code .\config\_default\params.toml
colorScheme = "slate"

ℹ️ Valid color options: congo, avocado, cherry, fire, ocean, sapphire, slate.

More: https://jpanther.github.io/congo/docs/getting-started/#colour-schemes

7. Organizing content #

https://jpanther.github.io/congo/docs/getting-started/#organising-content

8. Configuration #

https://jpanther.github.io/congo/docs/configuration/

9. Pushing to GitHub pages #

‼️only for the newly initialized repository:

new-item -ItemType File .gitignore
# git init # was already done
git add .
git commit -m "Initial commit"
git remote add origin git@github.com:rtdevx/rtdevx.github.io.git
git push origin main

Source: https://jpanther.github.io/congo/docs/hosting-deployment/#github-pages

10. GitHub Actions 1 #

📄 .github/workflows/hugo.yml

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# .github/workflows/hugo.yml

name: GitHub Pages

on:
  push:
    branches:
      - main
permissions:
  contents: write

jobs:
  build-deploy:
    runs-on: ubuntu-latest
    concurrency:
      group: ${{ github.workflow }}-${{ github.ref }}
    steps:
      - name: Checkout
        uses: actions/checkout@v3
        with:
          submodules: true
          fetch-depth: 0

      - name: Setup Hugo
        uses: peaceiris/actions-hugo@v2
        with:
          hugo-version: "latest"
          extended: true

      - name: Build
        run: hugo --minify

      - name: Deploy
        uses: peaceiris/actions-gh-pages@v3
        if: ${{ github.ref == 'refs/heads/main' }}
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_branch: gh-pages
          publish_dir: ./public

Source: https://jpanther.github.io/congo/docs/hosting-deployment/#github-pages

11. Update Congo using Git #

Git submodules can be updated using the git command. Simply execute the following command and the latest version of the theme will be downloaded into your local repository:

git submodule update --remote --merge

Once the submodule has been updated, rebuild your site and check everything works as expected.

Source: https://jpanther.github.io/congo/docs/installation/#update-using-git


» Sources « #

» References « #


  1. 10. GitHub Actions ⚠️
    Issue:
    remote: Permission denied issue emerged when implemented by following original instructions.

    Error:
    “remote: Permission to rtdevx/rtdevx.github.io.git denied to github-actions[bot].

    fatal: unable to access ‘https://github.com/rtdevx/rtdevx.github.io.git/’: The requested URL returned error: 403.

    Error: Action failed with “The process ‘/usr/bin/git’ failed with exit code 128”


    Solution:
    Sections highlighted in 10. GitHub Actions must be added in order to solve the permissions problem. ↩︎

RobK
Author
RobK
DevOps | Agile | AWS | Ansible | Terraform | PowerShell | Windows | Linux | Git