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

baseurl of '/' now breaks on GitHub pages #460

Open
dracos opened this Issue Jul 18, 2017 · 6 comments

Comments

Projects
None yet
4 participants
@dracos
Contributor

dracos commented Jul 18, 2017

Before submitting an issue, please be sure to

This issue affects

  • The site generated by GitHub Pages
  • Building sites locally

What did you do (e.g., steps to reproduce)

I pushed my site with a small change from the last push couple of weeks ago.

What did you expect to happen?

The site to appear as it has done for years :)

What happened instead?

All the styling is lost, because the upgrade to jekyll-github-metadata v2.5.0 means that a config with baseurl set to / is now overridden to baseurl "" and the templates were relying on baseurl being set to /. I understand that baseurl: "/" is incorrect and shouldn't be used (though I can't find any official documentation saying why this shouldn't work okay, only links to Parker's 2014 blog post), but anyway, I didn't expect the whole site to break by adding a new blog post :)

Additional information

gtrefs added a commit to gtrefs/gtrefs.github.io that referenced this issue Jul 19, 2017

gtrefs added a commit to gtrefs/gtrefs.github.io that referenced this issue Jul 19, 2017

@ankitbko

This comment has been minimized.

ankitbko commented Aug 16, 2017

I just made 2 line of changes and css of my entire site broke. There should definitely be a shout out when such breaking changes are introduced. Anyway what is the solution for this? Changing {{ site.baseurl }} to {{ "/" | relative_url }} will work?

@dracos

This comment has been minimized.

Contributor

dracos commented Aug 16, 2017

That is what I did in the commit I linked to above, yes (or if you have e.g. {{ site.baseurl }}sub/page/ changing that to {{ "/sub/page/" | relative_url }} and so on).

@ankitbko

This comment has been minimized.

ankitbko commented Aug 16, 2017

@dracos Thanks. By the way, it seems to be working fine locally. Any idea how to replicate it locally?

ankitbko added a commit to ankitbko/ankitbko.github.io that referenced this issue Aug 16, 2017

@dracos

This comment has been minimized.

Contributor

dracos commented Aug 16, 2017

@ankitbko You need JEKYLL_ENV=production so that should_add_fallbacks passes, and you need to add jekyll-github-metadata to your gems in _config.yml. With those two things, I get the same issue replicated locally.

arkivm added a commit to arkivm/arkivm.github.io that referenced this issue Sep 8, 2017

Fix site.baseurl to relative_url
Hope this fixes the broken site
Refer: github/pages-gem#460

Signed-off-by: Vikram Narayanan <vikram186@gmail.com>

purrloftruth added a commit to purrloftruth/old-personal-website that referenced this issue Sep 18, 2017

Fix issue with CSS not loading
Should fix issue introduced by
Refer: github/pages-gem#460

hiddenillusion added a commit to hiddenillusion/hiddenillusion.github.io that referenced this issue Oct 6, 2017

apophis90 added a commit to apophis90/apophis90.github.io that referenced this issue Nov 15, 2017

Removed base URL attribute since referencing e.g. stylesheets via {{ …
…site.baseurl }} caused 404 errors after having pushed to Github pages; This is probably related to github/pages-gem#460.
@vgaidarji

This comment has been minimized.

vgaidarji commented Dec 21, 2017

@dracos thanks for the tip 💪 . I was able to reproduce the issue locally.

zach-256 added a commit to zach-256/zach-256.github.io that referenced this issue Jan 3, 2018

rockoder added a commit to rockoder/rockoder.github.io that referenced this issue Jan 14, 2018

rockoder added a commit to rockoder/rockoder.github.io that referenced this issue Jan 14, 2018

rockoder added a commit to rockoder/rockoder.github.io that referenced this issue Jan 14, 2018

sstucki added a commit to sstucki/sstucki.github.io that referenced this issue Feb 1, 2018

teocomi added a commit to teocomi/teocomi.github.io that referenced this issue Feb 2, 2018

hukeyue added a commit to hukeyue/hukeyue.github.io that referenced this issue Mar 10, 2018

@meleu

This comment has been minimized.

meleu commented Mar 15, 2018

YAY! thanks for sharing the workaround!

ManZzup added a commit to ManZzup/blog that referenced this issue Apr 7, 2018

nbbrooks added a commit to nbbrooks/nbbrooks.github.io that referenced this issue Apr 8, 2018

zer4tul added a commit to zer4tul/zer4tul.github.io that referenced this issue May 2, 2018

soarcreator added a commit to soarcreator/soarcreator.github.io that referenced this issue May 3, 2018

janhenrik pushed a commit to janhenrik/janhenrik.github.com that referenced this issue Jun 16, 2018

zer0main added a commit to zer0main/zer0main.github.io that referenced this issue Jun 18, 2018

Switch from baseurl to using relative_url
Latest GitHub pages converts baseurl of '/' to ''.
github/pages-gem#460

zer0main added a commit to zer0main/starius.github.io that referenced this issue Jun 18, 2018

Switch from baseurl to using relative_url
Latest GitHub pages converts baseurl of '/' to ''.
github/pages-gem#460

ItachiSan added a commit to ItachiSan/itachisan.github.io that referenced this issue Jul 28, 2018

Fixing various link generation issues
Following the suggestions available here: github/pages-gem#460

hukeyue pushed a commit to windyland/windyland.github.io that referenced this issue Aug 18, 2018

Keyue Hu

cyruz-git referenced this issue in cyruz-git/cyruz-git.github.io Sep 3, 2018

camrinbraun added a commit to camrinbraun/camrinbraun.github.io that referenced this issue Oct 24, 2018

camrinbraun added a commit to camrinbraun/camrinbraun.github.io that referenced this issue Oct 24, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment