Search code examples
imagegithub-pagesoctopress

local images are not displayed, in octopress


I create a post and hope to display some local images, so I put some images in the folder of source/images/my_dir/image.jpg

And then I use the following two ways to display the pictures.

![method 1](../images/my_dir/image.jpg)
![method 2](http://my_username.github.io/my_dir/image.jpg)

And then I generate the post and deploy to github page.

I can see that the images is copied in the folder of _deploy/images/my_dir/

But method 1 is not working, instead, method 2 is working. Why is that?

PS:I am using windows7 to write the post in markdown pad.


Solution

  • In your atom.xml all img src must be of the form ![method 2](http://my_username.github.io/my_dir/image.jpg). Feeds reader must have resources full urls to display them correctly.

    In your post it's ![method 1](/images/my_dir/image.jpg)