`index.html` inside `public` folder looks different from `http://localhost:1313`?
chunyunma opened this issue ยท 3 comments
Thank you very much for the tutorial!
I followed each step and was able to recreate the site locally.
However, once I ran hugo
to generate the public
folder,
and opened the index.html
inside the public
folder,
it looked nothing like what I saw on http://localhost:1313
.
All the styles were gone.
Only the texts remained.
The hyperlinks to Blog
and Tags
did not work either.
Is this intended behaviour?
If so, does this mean that I need to deploy the entire folder,
not just the public
folder?
Thank you in advance for your help!
Hi @chunyunma.
When you browse the site from the local file system, it will not display correctly.
The site needs to be served by a web server.
When running the hugo serve
command, it uses hugo's built-in web server.
So, wherever you deploy your site, it will need to be served by at least a basic web server. (apache, nginx, etc.).
Or, use a service like Netlify, which takes care of the magic for you.
Thank you very much @zwbetz-gh !
I would not have known this, because I was operating under the assumption that whatever I found in the public
folder should be self-sufficient.
I tried Netlify and it worked!
:))
Glad to hear it ๐