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

Image is not loading properly in GitHub pages but in localhost #125

Closed
Hax4us opened this issue Jun 6, 2020 · 4 comments
Closed

Image is not loading properly in GitHub pages but in localhost #125

Hax4us opened this issue Jun 6, 2020 · 4 comments

Comments

@Hax4us
Copy link

Hax4us commented Jun 6, 2020

Environment

Expected behavior

Image must be loaded

Steps to reproduce the behavior

Affected page : https://hax4us.github.io/blog/about/
The same page is working perfectly in localhost

Other

@mmistakes
Copy link
Owner

mmistakes commented Jun 6, 2020

You need to use the correct path for the image... if you inspect source it's looking for https://hax4us.github.io/assets/Profile.jpg when your image is really in https://hax4us.github.io/blog/assets/Profile.jpg.

You'll need to apply {{ site.baseurl }} before it. This is why it works locally but not on GH where your site pages are in /blog.

Screen Shot 2020-06-06 at 1 48 03 PM

Closing as this isn't a theme issue.

@Hax4us
Copy link
Author

Hax4us commented Jun 6, 2020

Sorry for inconvenience but i was using blogger for years but now suddenly decided to migrate to gh pages. So i dont know how things works here :).

@Hax4us
Copy link
Author

Hax4us commented Jun 6, 2020

Can you please check this
https://github.com/Hax4us/blog/blob/master/about.markdown
I think i am doing it in wrong way
I just appended {{ site.baseurl}} in picture in about.md

mmistakes added a commit that referenced this issue Jun 8, 2020
@mmistakes
Copy link
Owner

Remove {{ site.baseurl }} from your about.markdown file, that won't work.
Instead you need to make a small adjustment to _includes/author and apply a relative_url filter. This will add the baseurl before the path so it can resolve correctly.

https://github.com/mmistakes/jekyll-theme-basically-basic/blob/master/_includes/author#L13-L20

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

No branches or pull requests

2 participants