0

I have set up gitlab pages for my user project. I access it under username.gitlab.io/project-name. The problem is that my index.html wants to load static files under /static/, like so:

<link rel="stylesheet" href="/static/styles.css?h=d722d99b">

but gitlab pages will search for static files under username.gitlab.io/static/, which do not exist, instead of username.gitlab.io/project-name/static/ where they actually are.

Is this normal and if so how can I do ?

Note that I could successfully publish group pages, that are accessible under group-name.gitlab.io (even if I had to enter group-name.gitlab.io/group-name.gitlab.io before the simple url was created).

Thanks

edit: related issue and potential fix: https://gitlab.com/pages/jekyll/issues/4

Ehvince
  • 17,274
  • 7
  • 58
  • 79
  • Is it a Jekyll site? You need to set up the base URL to your site. If it is a Jekyll site, the issue you mentioned should solve your problem. If not, you have to figure out where in your site configurations you set up the baseurl. ;) If you want I can take a closer look at your project, just need its URL. – Virtua Creative Feb 15 '17 at 04:52
  • It's a Lektor site, which [has doc](https://www.getlektor.com/docs/deployment/glpages/) for gitlab pages, but it's as I did and I can't see the base url setting. And, I fear that setting the base url will break the local preview (didn't try). Much glad for tips, [here](https://gitlab.com/vindarel/abelujo-website/blob/master/.gitlab-ci.yml) it is :) – Ehvince Feb 15 '17 at 11:14
  • 1
    Sorry for the delay @ehvince! I think the problem can be your [absolute URL setting](https://gitlab.com/vindarel/abelujo-website/blob/master/Website.lektorproject#L4). Try to make `relative` or `external` to see if it works :) Ref: https://www.getlektor.com/docs/project/file/ – Virtua Creative Mar 07 '17 at 03:37
  • Thank you very much ! I'll be able to build many more things on this :) – Ehvince Mar 07 '17 at 10:26

0 Answers0