-
Notifications
You must be signed in to change notification settings - Fork 305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hugo Theme CSS is not rendering #143
Comments
It's probably because your website is not served from the |
I have a |
What happens when you refresh your browser after seeing the theme is not displayed? I have had the same experience described above. I haven't done the verification on this yet, but I suspect it is due to the site rendering before the css is fully downloaded - which is why it would work on reload and work on a local server but not when hosted remotely and on your first visit to the site. You can also click on one of your links to another page and you may find that the theme is being rendered, as I do. |
it stays as it is after refreshing, even if I click on some of the links the styles still do not show, however one thing I noticed that when running the |
I encountered some problems similar to this and have worked my way through one of them. I thought I would document it here in case anyone encounters this in the future. I had a similar (but I believe different) problem than the OP in terms of rendering not working. My home page was not rendering properly but when I navigated back to the home page via links in my page, everything was fine. Here is what I believe the problem was. When I ran "hugo server," Hugo bound to http://localhost:1313. In my browser, however, I was typing http://127.0.0.1:1313. Although localhost is equivalent DNS-wise to 127.0.0.1, they are different URLs but with cross-origin=anonymous, the CORS same-origin attribute was being set (https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin). When I browsed to http://localhost:1313, everything was fine. Lesson learned! Now I need to work on the next problem - but I think it's related. |
I thought I'd post an update on this. The crossorigin matter was at the root of my other error as well. My hosting provider allows me to have both the www subdomain as well as the "naked" domain pointing at the same web site (as in www.example.com and example.com). My Hugo baseURL is defined as www.example.com. When I browsed to https://example.com, the CSS did not render because of the crossorigin configuration while going to www.example.com worked fine. I was able to configure a 301 Redirect on my hosting provider from example.com to www.example.com to solve the problem. |
Choose "www" or "non-www", then you need a dns record to redirect one to the other |
I've added the Hermit theme to use in my Hugo website, and started developing & adding content, evrything was working perfect in development mode(when I was running the hugo server
hugo server -D
) but when runhugo
command to build & deploy my site, only the ugly HTML was showing on my websitelike this
but when running the server the website looks great
Config.toml
& the pages paths are always redirecting to 404 not found
I'm really frustrated, I've tried everything & read the docs three times but still no fix whatsoever, any help would be appreciated
The text was updated successfully, but these errors were encountered: