-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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
Make relativeURLs work for urls inside css file or <style> #4355
Comments
This is a known limitation. Have you searched for a duplicate issue? |
Is this hard to implement, i have searched the code, got to transform/absurlreplacer.go, but i am not really familar with go. |
Yes it is. I suggest you look for older threads and workarounds for this. |
I searched again in the older threads, didn't find a workaround. But i thought out an ugly one for myself, to restrict all my production environment with the same root. |
I have the same issue, how did you manage to hack it? I'm trying to use .RelPermalink but it is relative to the base... |
@daviddavo The
Please use the forum (https://discourse.gohugo.io/) for questions and troubleshooting. We prefer to use GitHub for verified bugs and vetted enhancements. Thanks. |
Currenctly, relativeURLs only process those urls specified as href, for urls inside a style tag, it doesn't work.
For example
This tag is coded like that in an html file, which will be included in many other htmls.
Now in every html file, it is always './fonts/icon.eot', but there are cases it should be '../fonts/icon.eot' or '../../fonts/icon.eot'.
It seems like others have submitted issues similar. Let me clarify why this feature is needed, it's just like the href tag case.
I am hosting my same site code on many different production environment, and they may have different root. As in a environment A, the hugo site will be visited under http://example.com/, but in environment B, it is visited under http://example.com/hugo. As you can see, i can't use '/fonts/icon.eot' because the root is different.
This example what i extracted from ipfs static blog site. I want to visit my site from https://ipfs.io/ipns/... or a web hosting of mine with http://example.com/. Hope you understand now.
The text was updated successfully, but these errors were encountered: