[SOLVED] Hugo local host works but missing css in index.html from command "hugo"

Hi there,

I’m using the hugo-coder theme.

Theme: https://themes.gohugo.io/hugo-coder/

Steps to reproduce:

  1. hugo new site first_site
  2. cd first_site
  3. git submodule add https://github.com/luizdepra/hugo-coder.git themes/hugo-coder"
  4. copy the content of the example config file

The site works running on local host via the command “hugo server”.

But running index.html from the command “hugo”:

Things I tried:

  1. changing baseurl to “”, “./” and “/”

To test further, inside index.html, I changed href for “Blog” to go to 404.html:

Once clicked, the path goes to C:/404.html instead of C:/Users/Me/Desktop/Hugo/first_site/public/404.html

So, href is not working as intended and baseURL affects this but I’m not sure what to put in there.

My goal is to be able to run index.html from any machine and have the site working.

Thank you for your help.

** Update:
Hello, I got it to work by changing:
baseurl = "."
custom_css = "css/file.css"

  • where file.css is the name of the css file created in public/css folder