Skip to content.

Hugo: baseURL set in GitHub Actions

Collaborative websites need to be forked, but if you set baseURL the forked website will load resources from the original.. Not ideal. The fix I applied to my GitHub Actions CI to work around this: jobs: deploy: runs-on: ubuntu-latest defaults: run: shell: bash steps: - name: Build 🔨 run: | hugo --baseURL https://${GITHUB_REPOSITORY%%/*}${GITHUB_REPOSITORY#*/} This overrides the configured baseURL at build time with your GitHub account name as the subdomain and the repository as the directory. Read more →
Joe Heaton



Joe’s technology-focused murmurings.