I'm currently in the process of building a static blog with Hugo utilizing these resources (here and here).
After setting up Hugo and creating a basic placeholder blog post for initial testing, I noticed that the page displays correctly when I run hugo server -D
and navigate to localhost:1313
in a browser. However, the same page does not render correctly when directly accessed by opening public/index.html
in a browser.
The configuration file being used is from the theme included with my chosen design. Within this config file, I've customized elements like the theme name, baseURL set to '/', as well as smaller details such as authorship information, descriptions, and copyright.
Why is it that index.html
renders properly when served through the local Hugo server but malfunctions when accessed as a standalone file via a web browser?
Here you can see my blog rendering correctly through the Hugo server
Here is an example of my blog post rendered incorrectly through direct access of the index.html file
This snippet showcases my current configuration setup:
CopyPasteYourConfigFileHere
Furthermore, here is the raw code for the generated public/index.html
:
YourGeneratedIndexHtmlCodeHere