It’s possible in the Cloudflare Pages UI to override the env var CF_PAGES_URL for the production branch only + using a build script like hugo -b $CF_PAGES_URL --minify.

That’s what I did. I used the CF_PAGES_URL as / and it worked. The website is live!

Found it here, via Google.