Not able to load images on Github pages Blog post

Home / Uncategorized / Not able to load images on Github pages Blog post

Question:
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.


Answer:
Create a folder to hold your posts images at root level
mkdir images

Move the directory structure containing the images to the above folder
mv _posts/DV_files/ images/

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.
Read more

Leave a Reply

Your email address will not be published. Required fields are marked *