Is Hugo build supposed to be broken when you open index.html locally?

I’m building my webpage with “Hugo“ command, but everything is broken… css not loading on all or some pages, some links points to actual URLs instead of local pages, etc
What I’m doing wrong? “Hugo Server“ just displays everything fine in localhost

Doing something like google-chrome public/index.html isn’t going to work (generally speaking) unless you’ve designed a site to be serverless.

1 Like

Oh, so it’s fine to be broken locally? It should work when I actually host it in configured URL?

Presuming you’ve done everything correctly:

  1. Running hugo server locally will render the site correctly
  2. Running hugo then serving the files in public with a web server will render the site correctly.
1 Like

Thanks, but I gotta ask one more kinda related thing… What’s up with “absURL“, “relURL“, etc? When and why should I use them?

Example: serving your site from a subdirectory:

See https://gohugo.io/functions/urls/relurl.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.