Include a link to the source code repository of your project, because we really need the context of seeing your templates and partials to be able to help you. It is trivial to do a quick git clone on your repo, then run hugo server in your project, to help you out. On the other hand, recreating your code from screenshots, or sort of guessing at it, is not.
If you can’t share your repository for whatever reason, consider creating a dummy repo that you can share, which reproduces the problem you’re experiencing.
You should check the URL that is used when it’s “not working” in your browser’s developer tools. My guess is that you reference the CSS in an awkward way. But since you’re not showing your code, there’s no way to know.
If you can’t share your repository for whatever reason, consider creating a dummy repo that you can share, which reproduces the problem you’re experiencing.
A couple of different things can cause this issue:
The links to your css is looking in the dir that the final pages are in. To make it look at the site root for the css, you may have to precede it with a / in the href quotes of the css link. So for instance it’ll be href=“/css/style.css” instead of href=“css/style.css”.
The rewrite rule of the webserver software config. This will depend on what sort of software you’re using to host. Both Apache2 and Nginx can have subdirs setup to where it changes the root if someone tries to request a page within. Removing said subdir configs may help with this behavior if you can do without them.
Although it’s hard to tell what’s going on without at least a mock git repo (doesn’t have to have the same content, just the layouts and basic css), this is the best advice I can offer blind.
Hi all - once again thanks for tips. During the investigation and preparing the dummy version of the site, I’ve spotted, that having relativeURLs = “true” setting enabled in config files was causing he issue.