Hugo sites to standalone binary?

Hugo content and server are separate things, but is there a way to put content of multiple sites and a web server into a single binary that can be readily deployed?

Do you mean a self-extracting archive ?
Because one project directory equals one site, you can’t blend them.

Not with hugo.

And keep in mind that hugo server is for development only. So you’ll need some other.

I suppose there would be some kind of internal folder structure but not as file extraction. Literally a single binary with the necessary logic to deliver pages, certificates etc. It seems the answer is no, so maybe that could be a future project for me… or I should learn docker…

I’ve heard of people successfully wrapping a Hugo site inside an Electron project. Sadly I have no more information about that.

1 Like

I assume the point would be for clients not to touch or see anything ? Otherwise a batch script would do the trick.

Actually, was just thinking how easy and portable it would be.

If you want to include a web server, it would be hardly portable – there’s at least Linux, macOS and Windows out there. Not to mention that people would have to configure a web server. And that Hugo would have to be configured with the correct baseURL before running hugo.

So, instead of asking for details of a solution, perhaps you could begin with describing the problem you want to solve?

Well, portable within the same platform e.g. on all linux systems of the same architecture.

And you make my point, there would be no web server configuration. The baseURL is already listed in config.yaml What other configuration was you thinking? I admit, the site certificate part has me a little stumped, but it doesn’t strike me as impossible.

The main benefits to it’s users is how easy and fast it is to deploy. Or to pass around the same content to multiple parties, again, with the absolute minimum of setup time.

Also, since making this post, I’ve been wondering whether IPFS might be better match.