Open built website from local folder without running a server

I want to use Hugo to build my Markdown notes into an HTML site. Besides hosting it on github, I also want a private part of the webpage, which I can open just on my computer locally, without running a server.

The build process works if I use hugo server but if I use hugo build I don’t know how pick baseUrl such that I can open the webpage on my computer without running any kind of server.
I tried things like baseUrl = C:\webpage_dir\public etc.

What you are trying to accomplish is more difficult than you might imagine.

1. When you are building the site for local use (no server), you need to set the following options to true:

2. Your theme (or custom layouts) must be designed with this dual-usage in mind.

3. Links and images within your content must be created with this dual-usage in mind.

If you are a new Hugo user, you may find this to be… challenging.

3 Likes

Thanks for the hints (and the warning :wink: ).

I’m new to Hugo, but so far I like it a lot. I’m using the yihui/hugo-xmin template, which is minimal enough so that I can still integrate those things.

1 Like