How to save a Hugo site as HTML files?

I have a site in Hugo markdown. It is mainly composed of markdown (.md) files.

I have the full Hugo site, with public/, layout/, layout/shortcodes/ folders, etc. I am using a docsy theme, on Windows. I launch the site with the command hugo server -D, and I can see the site in my browser at localhost:1313/docs.

When the Hugo site is running, those .md files are automatically published on the localhost site; so I imagine that Hugo must convert those files to HTML internally.

I would like to find a way of automatically converting the .md Hugo site files from markdown to .HTML files on the disk. In other words, I want a mirror of the .md file structure, but in HTML, in the form of files, on the disk. I imagine that is what the Hugo site does anyway, so that the browser can show the site. But it does that on the fly, and I can't find a way of saving the files on the disk.


I have run hugo server -D.

For clarity, hugo server -D will not create .html files. It only serves files on the fly (as you suggest in your original question).

To generate .html files in the public folder of the website, you must either run just hugo or e.g. hugo -D at the command line, generally in the same directory as config.toml (i.e. you shouldn't include server in the command).


(Answer provided by @Anaksunaman ) I launched just hugo instead of hugo server -D and now I see the .HTML files.