Viewing a site without a server

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:

  1. baseURL = "/" in site configuration
  2. uglyURLs = true in site configuration
  3. relativeURLs = true in site configuration
  4. 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

5 Likes