1

I wanted to publish a blog post, which contains a plot. I am perfectly able to view and load the image in markdown, but when I try to publish to on my github pages, I can see everything perfectly except for the plot. Here is my Github repo for my blog and here is the markdown file I wish to post online.

In the above post I am trying to display the image with: ![](DV_files/figure-html/unnamed-chunk-2-1.png) having the image located at _posts/DV_files/figure-html/unnamed-chunk-2-1.png.

marcanuy
  • 23,118
  • 9
  • 64
  • 113

1 Answers1

0
  1. Create a folder to hold your posts images at root level

    mkdir images
    
  2. Move the directory structure containing the images to the above folder

    mv _posts/DV_files/ images/
    
  3. Use the new path and use absolute_url to generate the full url

    ![]({{"/images/DV_files/figure-html/unnamed-chunk-2-1.png"|absolute_url}})
    

Now your images will appear in the post.

marcanuy
  • 23,118
  • 9
  • 64
  • 113
  • I tried as per your instructions. But it turns out not only am I not able to to see my images on post, the images now doesnt load on .md file either. [MD file](https://github.com/Arjitkp/arjitkp.github.io/blob/master/_posts/2017-08-15-DV.md) [Github Rep](https://github.com/Arjitkp/arjitkp.github.io) – Arjit Kapoor Aug 15 '17 at 16:27
  • UPDATE: I just refreshed again, and I can now see my image. Thanks a lot. :) – Arjit Kapoor Aug 15 '17 at 17:03