Skip to content
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 CSS styles broken on GitHub Pages with a custom domain (baseURL problem?) #2

Open
pdurbin opened this issue Dec 6, 2024 · 1 comment

Comments

@pdurbin
Copy link
Member

pdurbin commented Dec 6, 2024

I followed https://gohugo.io/hosting-and-deployment/hosting-on-github/ and the site looked normal at https://iqss.github.io/hugo.dataverse.org/

Then I added hugo.dataverse.org as a custom domain and the CSS files are trying to come from weird URLs like https://hugo.dataverse.org/hugo.dataverse.org/assets/css/stylesheet.d6fcd20a4fb86efa4dfac8ec95da60244cc8871042183da1ef28e3a762ad79c8.css making the UI unstyled and crazy:

Screenshot 2024-12-06 at 5 04 27 PM

Over at https://discourse.gohugo.io/t/publication-on-github-pages-and-baseurl/43631 there are suggestions like this:

  • set baseURL = "/" but all your internal links need to be relative (not the best…)
  • add relativeURLs = true but maybe other things will break, you have to check internal links

Here's my current config:

% cat hugo.toml 
baseURL = 'https://hugo.dataverse.org/'
languageCode = 'en-us'
title = 'The Dataverse Project'
theme = 'PaperMod'
[params]
showBreadCrumbs = true
@pdurbin
Copy link
Member Author

pdurbin commented Dec 6, 2024

In 854a0b4 I changed baseURL to / and it looks normal now. Weird.

Screenshot 2024-12-06 at 5 14 18 PM

I'd like to understand baseURL better.

https://gohugo.io/getting-started/configuration/#baseurl has this to say:

"baseURL
(string) The absolute URL (protocol, host, path, and trailing slash) of your published site (e.g., https://www.example.org/docs/)."

So I feel like I'm doing it wrong. I guess I'll keep this issue open for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant