See:
https://discourse.gohugo.io/t/open-built-website-from-local-folder-without-running-a-server/34193/2
To build your site for use without a webserver (i.e., navigating to public/index.html and then opening the file with your browser) requires:
-
baseURL = "/"
in site configuration -
uglyURLs = true
in site configuration -
relativeURLs = true
in site configuration - Removal of all
integrity
attributes on CSS, JS. See themes/congo/layouts/partials/head.html.
And you will still run into some issues, most notably that Hugo sets the home page permalink to “/” instead of “index.html” when uglyURLs is enabled.
Not sure it’s worth the effort when you can just… hugo server