Do you are hosting your Jekyll site on Github and are writing a new blog post. You go to add an image within the post using Markdown and it fails. You double check the path and its correct. You try adding a leading “/” to no avail.

You then pull up dev tools and notice that the image path is tacked onto the end of the post URL. That isn’t what you want.

You immediately do some Google searching and half an hour later you are confused about baseurl. Rest assured, you will eventually find an answer, but for now let me speed that search up for you Jekyll newbies (like me).

Here is how you do it:

Say your path is assets/images/family.jpg

All you do is put {{site.url}} or {{site.github.url}} before your path.

Thats all.

Cheers!

Travis Rodgers

Buy Me a Coffee at ko-fi.com

Hi, I'm the Travis in Travis.Media. I'm a self-taught software developer, blogger, and YouTuber, sharing everything I'm learning along the way.

Show comments