Skip to content
This repository has been archived by the owner on Nov 30, 2024. It is now read-only.

How to use BASE_PATH in a post #65

Closed
bilke opened this issue Mar 16, 2012 · 2 comments
Closed

How to use BASE_PATH in a post #65

bilke opened this issue Mar 16, 2012 · 2 comments

Comments

@bilke
Copy link

bilke commented Mar 16, 2012

I am writing a post in markdown and include an image which is located in images/pic1.png:

![This is an image][img-ref]

[img-ref]: /images/pic1.png

This works fine when running locally but when published to GitHubs project pages the image url does not work as expected.

When I change the ref to [img-ref]: {{ BASE_PATH }}/images/pic1.png it also works locally but not on GitHub.

When I change the ref to [img-ref]: {{ site.JB.BASE_PATH }}/images/pic1.png it works both locally and on Github but always (also when developing locally) inserts the link to the image hosted on GitHub.

So what is the correct usage of BASE_PATH in posts (and also pages)?

Thanks!

@LukasKnuth
Copy link
Contributor

I'm a little confused about this, too.

@plusjade please clarify this.

@bilke
Copy link
Author

bilke commented Mar 18, 2012

I am sorry, this was my fault.

I forgot to call {% include JB/setup %} at the beginning of my post. After this is done the image ref works correctly with the BASE_PATH:

[img-ref]: {{ BASE_PATH }}/images/pic1.png

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

No branches or pull requests

2 participants