I am new to hugo and maybe I totally missunderstand the term “static site generator”.
Based on md-files I want to create HTML files in a directory. I want to copy and access them on file system level. I want to read them via clicking on them (means open them via
file:\\\) in a browser of my choice.
I do not want to run a server on my (or other) machine just to see my content.
“static” means for me “without a server”. In that case I have a bunch of HTML files and can do with them what ever I want: Use them local on my filesystem or load them up to a webserver.
Am I wrong here?
You are wrong. To develop you do
hugo server so you can see how the pages work. With
hugo you create a folder
public that on your server will work properly.
Both cases won’t work with the file:// approach because the linked assets (images/styles) won’t work with the file protocoll.
Thanks for that tip.
Mhm… Let me ask direct: Is there a way to generate HTML content with hugo that would work with the file:// approach?
Yes, but it is not easy, particularly if you are using a theme that hasn’t been designed with this in mind.
It seams like that I have to do my own Python tool to generate (for me usable) HTML files (out of my org-roam-v2 files).
@Codeberg-AsGithubAlt To build upon the settings suggested by @jmooring in that post, I have created an example that you can clone and test by running
hugo locally. See instructions on one of the example pages.
Relevant commit to make a site navigable offline: Make the site navigable with offline HTML (268e5cf7) · Commits · hugo-mwe / Hugo MWE · GitLab
The example also attempts to fix the issue with links back to homepage when looking at the content offline.
As he and I have suggested earlier, how well your site works offline depends on the theme design (the theme decides not just for looks but also how the links to various pages, sections, etc. work).
This example works well (from the brief testing I did), both online and offline.
In this GIF, you can see me clicking through all the links; you can see the file:// protocol in the address bar.
What’s next? You will certainly need to read up on the Hugo Docs as this is your first time using this tool.
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.