-
Notifications
You must be signed in to change notification settings - Fork 29
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
problem with backgrounds when relativeURLs is needed #11
Comments
Hey @pooh22 , I'm not sure of any easy fix. To be honest, i'm pretty inexperienced, so perhaps this wasn't the best approach for handling the background image. If you think of a better way, feel free to PR it or even just explain here how you handled it. Can you provide more information about which links are broken? If I have time I will take a look this weekend. |
Hi Jeremy, that makes two of us ;-) I'm also quite new to hugo and not an experienced web developer... I figure that everywhere you set the background image via (inline) css, hugo doesn't touch it after generating the string output. I can't judge whether hugo should process these links. From the commented-out lines in the css file I gleaned that you ran into similar problems when setting the background via the external css files, is that right? My html+css experience is not great, so at the moment I can't think of an alternative way to do the same thing. I guess the relativeURLs thing in hugo looks for links in href and src references, so if you can figure out a way to do the background setting using these html elements, it might work... Cheers, Simon |
I just had a look at the sources of hugo, it seems I was right, but it's probably going to take quite a bit of work to fix it in hugo for the current state of HugoMDL... look in hugo sources: transform/absurlreplacer.go
So the fix could be in the theme, to avoid setting urls via css, or it could be fixed in hugo to also process urls in css when abs or rel URLs are requested. |
On 17-10-16 16:18, Bjørn Erik Pedersen wrote:
One of the suggestions in the thread mentioned was to put {{ This kind of works ok, but in the entire theme are a lot of these Cheers Simon |
Search and replace ... |
Hi Jeremy,
I'm struggling to figure out how I can put the generated site (using theme HugoMDL) in a subdirectory. In several places in the template code, you use something like style="background-image: url('{{ .Site.Params.background }}');"
I've tried to explain it in the discuss forum: https://discuss.gohugo.io/t/need-help-understanding-url-conversions/4294/13
Basically when I place the site under a baseurl of http://example.com/subdir/ Some links are broken, which should not happen when relativeURLs is set to true in the config.toml.
Do you have any idea if this can be fixed in the theme?
Cheers
Simon
The text was updated successfully, but these errors were encountered: