Skip to content
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

URLs appear twice on site deployment #30

Closed
svanimisetti opened this issue Feb 26, 2017 · 5 comments
Closed

URLs appear twice on site deployment #30

svanimisetti opened this issue Feb 26, 2017 · 5 comments
Assignees
Labels

Comments

@svanimisetti
Copy link

I tried forking the base repo and changing the project setting to serve GitHub pages from master branch. I updated the 'url' variable in _config.yml file. The 'baseurl' variable is empty. I can see the site firing up - but the URLs are all doubled-up. When I browse to the main site, I see the same behavior. Is this a problem with my browser? I am using Google Chrome Version 56.0.2924.87 (64-bit).

@jwillmer
Copy link
Owner

Hi, I see the problem, it is also happening on the auto generated GitHub page of this blog template. I think GitHub is using a new Jekyll version that works differently as before. I will investigate and fix it.

@jwillmer jwillmer self-assigned this Feb 27, 2017
@jwillmer jwillmer added the bug label Feb 27, 2017
jwillmer added a commit that referenced this issue Feb 27, 2017
Try to quick fix issue: #30
jwillmer referenced this issue Feb 27, 2017
@jwillmer
Copy link
Owner

I created a bug report at Jekyll: jekyll/jekyll#5908

@pathawks
Copy link

The problem is with the way you are building URLs.

The problem went unnoticed before jekyll/github-metadata#76 because your baseurl is empty, but now that it is being set automatically the links are broken.

site.github.url apparently contains the full URL to the site, and you do not need to use baseurl at all if this is how you'd like to build URLs.

If you want to use site.url instead, you will have to flip your prepend statements.
If baseurl is /jekyllDecent and site.url is http://jwillmer.github.io (and this is what they are when GitHub builds the site):

{{ "/css/screen.css" | prepend: site.url }} will give us http://jwillmer.github.io/css/screen.css
If we try to prepend the baseurl to that ({{ "/css/screen.css" | prepend: site.url | prepend: site.baseurl }}), we end up with /jekyllDecenthttp://jwillmer.github.io/css/screen.css. A browser will resolve this URL as http://jwillmer.github.io/jekyllDecenthttp://jwillmer.github.io/css/screen.css

I would suggest using the absolute_url filter instead, as it takes care of this complexity for you.

@jwillmer
Copy link
Owner

Thank you for your help and detailed error description @pathawks. I commited the changes and it looks like all references are fixed now.

jwillmer added a commit that referenced this issue Feb 27, 2017
jwillmer added a commit that referenced this issue Feb 27, 2017
jwillmer added a commit that referenced this issue Feb 27, 2017
jwillmer added a commit that referenced this issue Feb 27, 2017
jwillmer added a commit that referenced this issue Feb 27, 2017
jwillmer added a commit that referenced this issue Feb 27, 2017
jwillmer added a commit that referenced this issue Feb 27, 2017
jwillmer added a commit that referenced this issue Feb 27, 2017
jwillmer added a commit that referenced this issue Feb 27, 2017
jwillmer added a commit that referenced this issue Feb 27, 2017
jwillmer added a commit that referenced this issue Feb 27, 2017
jwillmer added a commit that referenced this issue Feb 27, 2017
jwillmer added a commit that referenced this issue Feb 27, 2017
jwillmer added a commit that referenced this issue Feb 27, 2017
jwillmer added a commit that referenced this issue Feb 27, 2017
jwillmer added a commit that referenced this issue Feb 28, 2017
@jwillmer
Copy link
Owner

Now it finally works as intended and I also used this bug to refactore some url patterns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants