-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Wrong Permalink for resources in sites with baseURL with sub-path and canonifyURLs=true #5226
Comments
Hi, I'm also affected by this issue, is this going to be corrected or is it a feature? |
I have added a PR with some tests in this area. I expected them to fail, but they don't. If this is still an issue, I need a concrete and failing test case to be able to fix this. |
Here is the Hugo Bootstrap Premium Theme that was recently removed from the Hugo Themes Showcase due to missing CSS and JS assets. In its templates this theme uses On Steps to reproduce locally
As a fix we have been recommending that theme authors should use CC / @digitalcraftsman |
OK, I see what's going on here. This happens when @digitalcraftsman @onedrawingperday I will update the theme builder script to disable canonifyurls for the demo sites. |
I may look at this later; I have turned off "canonifyURLs" on the theme site, but that may have other side effects. |
Actually @bep it does cause problems. But since Now a theme like the Hugo Bootstrap Premium that you re-added with commit gohugoio/hugoThemes@2d9f912 works fine. However themes that either have an Example Site like Hugo Fresh or rely on the Hugo Basic Example like Tale Hugo that have committed their Hugo Pipes Resources and use a
It seems that now with I don't know how to fix this and it seems like a catch 22. Don't know if you have the time @bep maybe try executing the Build Script with these 2 themes that I mentioned above. May be |
Ok. I just saw that as I posted the above comment you made a new commit that closed this issue. I will take a look again and see if the problems I mentioned above are fixed. |
I have reverted my changes in the themes repo. Please don't make this issue into a bigger issue than it is.
|
Hello, This is probably a fringe boundary use case that only I would run into but I thought I would throw it out there in case it helps anyone else: Issue: When using
Hugo will write in the path for the resource as All other paths (such as live reload, images, etc) are correct using the bound IP address. Fix: As @bep pointed out above, one way to address is to use
Additional Note: Perhaps the documentation on this page https://gohugo.io/hugo-pipes/introduction/ could have a mention of the |
See: gohugoio/hugo#5226 This allows ignoring baseUrl (supporting multiple deployments).
I'm still having problems relating to all this, e.g. deploying a site with images to GitHub pages when it is a Project Page based site. Unless I turn E.g. The first image url refers to an image inside ![png your image](/blog/images/fred.png)
![png your image](/images/fred-uml.png) Assuming <img src="blog/images/fred.png" alt="png your image">
<img src="images/fred-uml.png" alt="png your image"> This only happens with images, all other links e.g. cross-references are generated ok. Seems this is also related to #5736 however the fix of removing the leading |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
hugo
versions up to and including 0.42.2 used completebaseURL
URL to create absolute permalinks for resources. Later versions use only host part of the config, which breaks sites that use path in thebaseURL
config.The change that introduced the breakage is this: dea7167#diff-237662eaccac0a9acb0b64febadb5b5aR690
Official documentation on the other hand still states that
baseURL
should be (quote from docs): Hostname (and path) to the root.Was this done on purpose and hugo does not support having path parts in the
baseURL
?The text was updated successfully, but these errors were encountered: