hugo
Hugo is the world’s fastest framework for building websites, written in Go.
Setup Hugo¶
Ubuntu¶
Download and install the hugo deb file from the release page.
Windows¶
chocolatey:
Go compiler is needed for Hugo modules
GitHub actions¶
name: Deploy Hugo site to Pages
on:
  push:
    branches: [main]
  pull_request:
    branches: [main]
  workflow_dispatch:
# Allow only one concurrent deployment
concurrency:
  group: pages-${{ github.ref }}
  cancel-in-progress: true
jobs:
  # Build job
  build:
    runs-on: ubuntu-latest
    steps:
      - name: checkout
        uses: actions/checkout@v4
        with:
          submodules: true # Fetch Hugo themes (true OR recursive)
          fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
      - name: Setup Hugo
        uses: peaceiris/actions-hugo@v2
        with:
          hugo-version: 'latest'
          extended: true
      - name: Caching Hugo Modules
        uses: actions/cache@v4
        with:
          path: ~/.cache/hugo_cache
          key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.sum') }}
          restore-keys: |
            ${{ runner.os }}-hugomod-
      - name: Setup Pages
        id: pages
        uses: actions/configure-pages@v3
      - name: Build
        run: hugo --gc --minify --baseURL ${{ steps.pages.outputs.base_url }}
      - name: Upload artifact
        uses: actions/upload-pages-artifact@v2
        with:
          path: ./public
  # Deployment job
  deploy:
    needs: build
    if: github.ref == 'refs/heads/main'
    # Grant GITHUB_TOKEN the permissions required to make a Pages deployment
    permissions:
      pages: write # to deploy to Pages
      id-token: write # to verify the deployment originates from an appropriate source
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    runs-on: ubuntu-latest
    steps:
      - name: Deploy to GitHub Pages
        id: deployment
        uses: actions/deploy-pages@v2
Docker¶
klakegg/hugo docker image.
Hugo themes¶
A list of Hugo themes I found useful
Documentation¶
- gethyas/doks
- alex-shpak/hugo-book. Template: sosiristseng/template-hugo-book
- thegeeklab/hugo-geekdoc
- McShelby/hugo-theme-relearn. Template: sosiristseng/template-hugo-relearn
Blogs¶
- HEIGE-PCloud/DoIt. Template: sosiristseng/template-hugo-doit
- hugo-fixit/FixIt. Template: hugo-fixit/hugo-fixit-starter
- chipzoller/hugo-clarity
- cntrump/hugo-notepadium
- adityatelange/hugo-PaperMod
- razonyang/hugo-theme-bootstrap
- reuixiy/hugo-theme-meme
- CaiJimmy/hugo-theme-stack. Template: CaiJimmy/hugo-theme-stack-starter
- hugo-toha/toha
- HugoBlox/hugo-blox-builder
Hugo theme components¶
- Hugo modules: Various modules for Hugo
- hugo-notice : A Hugo theme component to display nice notices.
Hugo tips¶
Parse relative links¶
You can use this form normally in Hugo
by adding the following lines to project/layouts/_default/_markup/render-link.html