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

Local testing with Jekyll is using wrong url parsing #67

Open
chmendoza opened this issue Oct 8, 2019 · 2 comments
Open

Local testing with Jekyll is using wrong url parsing #67

chmendoza opened this issue Oct 8, 2019 · 2 comments

Comments

@chmendoza
Copy link

Hi,

I a getting bad rendering and broken links on local testing with bundle exec jekyll serve. The rendering on Github Pages is great. I believe the problem might reside in lines like this one:

<link rel="stylesheet" href="{{ site.github.url }}/assets/css/main.css">

What should I do? Thanks!

@chmendoza
Copy link
Author

I solved! I replace site.github.url with the filter absolute_url, as suggested here:

https://jekyllrb.com/docs/github-pages/#project-page-url-structure

@chmendoza
Copy link
Author

Now I screw rendering on Github Pages. I changed to relative_url just for the css files. It's weird that I can use the full path of an image under /assets/img/ but for the css files it has to be a relative path. That fixed the issue. Now with local testing and rendering on Github Pages!! Thanks!

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

No branches or pull requests

1 participant