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

how to reference images in markdown-compliant manner? #27

Open
gernotstarke opened this issue Dec 7, 2016 · 3 comments
Open

how to reference images in markdown-compliant manner? #27

gernotstarke opened this issue Dec 7, 2016 · 3 comments

Comments

@gernotstarke
Copy link

In markdown I usually reference images like

![](images/filename.png)

that seems NOT to work here.. any idea?

@ttskch
Copy link
Owner

ttskch commented Dec 13, 2016

@gernotstarke Thanks for using. You can use /assets/img/ dir for putting your own images. For example,

image

This change shows the specified image correctly like below.

image

I hope this helps you. Thanks.

@gernotstarke
Copy link
Author

gernotstarke commented Dec 13, 2016 via email

@ttskch
Copy link
Owner

ttskch commented Jan 13, 2017

@gernotstarke So sorry for my late response 🙇

And I belatedly realized that relative path like assets/img/ogp.png works well in a limited situation. It works well only when the jekyll site is located immediately below the domain top (iow, url of the site is like http://xxx.github.io/ or http://localhost:4000/) and the page using the relative reference is the top page (iow, url of the page isn't http://xxx.github.io/some-posts/ but just http://xxx.github.io/).

So you have to use absolute path every time. In this case, I think you have to do below:

  1. If your site has some baseurl (iow, url is like http://xxx.github.io/site-name/)
    • Write markdown like ![](/site-name/assets/img/ogp.png)
  2. If your site has no baseurl (iow, url is like http://xxx.gihutb.io/)
    • Write markdown like ![](/assets/img/ogp.png)

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

2 participants