Open fedelibre opened 5 years ago
I ran into this issue too for a project using github pages. I'm still digging around for the root cause but I don't think its a naming issue in the style tag. It looks like the urls paths are not generating correctly off the baseURL
.
The domain name for a github-pages site is https://github.<username>.io/<project_name>
and this is set in my config.toml
file correctly.
{{$img.src | absURL }}
generates the url for the image so if my image path is /img/hello.jpg
, the final url should come out as https://github.<username>.io/<project_name>/img/hello.jpg
rather than incorrectly as https://github.<username>.io/img/hello.jpg
. Not sure why the <project_name>
path got chopped off. The example site mirrors this problem.
What's confusing is that this isn't happening for all static resources that are passed into baseURL
, ie the profile image and the javascript script resources. I'll continue investigating...
I think that this is related to this bug on Gitlab demo page: https://gitlab.com/pages/hugo/issues/20
Also, someone made a fix to a similar issue with the css: https://discourse.gohugo.io/t/baseurl-for-deployment-messing-up-links-to-static/9214/16
Ok, I just found that this is a duplicated bug, the bug with the issue and the fix is this: https://github.com/halogenica/beautifulhugo/issues/26
sed -i -r 's/\"\{\{\$img\.src \| absURL \}\}\"/"{{$.Site.BaseURL}}{{$img.src}}"/g' ./themes/beautifulhugo/layouts/partials/header.html
It replaces "{{$img.src | absURL }}"
with "{{$.Site.BaseURL}}{{$img.src}}"
.
Soo.. removing the blog post of example of the bigimage feature was simplier. Hahaha.
The bigimg example in the example site is not working because the website static dir is not in the web server root.
Perhaps the problem is here?