Hugo --minify output is inconsistent

I’m using GitHub Actions to deploy my Hugo website to GitHub Pages. I noticed that it changed output in the last 24 hours without code changes, so I dug into this more.

At first I was not able to duplicate the issue locally. Then I updated versions.

  • Go
    • Old: 1.15
    • New: 1.17
  • Hugo
    • Old: v0.96.0+extended darwin/arm64 BuildDate=unknown
    • New: v0.97.1+extended darwin/arm64 BuildDate=unknown

And I ran hugo mod clean --all and reset my go files to ensure my modules were up-to-date.

I am now able to duplicate the issue locally. Through many runs of this Bash command I have seen different outputs multiple times:

rm -rf ./public_old; cp -r ./public ./public_old; rm -rf ./public; hugo --quiet --minify; [ -d "./public/fonts" ] && echo "fonts/ directory exists"

Specifically, the majority of the time it’s not generating directories which belong to my theme and Twemoji module.

  • fonts/
  • icons/
  • twemoji/

About a 1 in 15 chance of the directories being created from my testing. Perhaps I’m not using hugo --minify as intended? It came from the GitHub Actions docs.

# config.toml

disableKinds = ["taxonomy", "term"]

  disable = false
  ignoreConfig = false
  ignoreImports = false
  path = ""
  disable = false
  ignoreConfig = false
  ignoreImports = false
  path = ""

enableGitInfo = true

  home = ["HTML", "RSS", "JSON"]
<!-- go.mod -->

module {my github repo}

go 1.17

require ( v0.3.0 // indirect v0.0.0-20220410084245-65b76042967a // indirect
<!-- go.sum --> v0.3.0 h1:jfd+zYe2EyQhc40FWNqK1x+/YbCefw6ZuMpUcDlSbcc= v0.3.0/go.mod h1:3A+EjJ50vQEkmnEfhEY3RqPXozuWudsGwHx2UAUn9tA= v0.0.0-20220410084245-65b76042967a h1:bsd3UpOPjyik/cPVvj5t8kVQCpXbDBPF9pkxkJqHINU= v0.0.0-20220410084245-65b76042967a/go.mod h1:tf1kQIBUcwJ/3mRFU5eiMrMvsDScVTK2IEFsZE3hZOc= v13.1.0+incompatible/go.mod h1:06L6PdKuWDx/Yh6s4B7yGkAeBmWZzbFZgfNnWlJPPYM=
# gh-pages.yml

- name: Setup Hugo
  uses: peaceiris/actions-hugo@v2
    hugo-version: 'latest'
    extended: true
- name: Build with Hugo
  run: hugo --minify

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

Ah, this seems to be the /static synching bug in v0.97.2. I figured I was doing something wrong that I forgot to double check source code.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.