When i have my image in a folder named "Image" and my file "sample.md" is in the Root, then i access the picture "pix.jpg" with the path "image\pix.jpg". But how i access the the picture, when the file "sample.md" is in a subfolder?
That means "sample.md" ist in the folder "/_posts" and the pictures are in the folder "/image". I tryed with the prefix "[repository]/image/pix.jpg". Nothing works. Please a little information to solve my confusion.
Solved! Solved! Go to Solution.
Hey there @PeterGyger, help's arrived.
You can reference static files (like images) to your Jekyll posts by adding it them to a subdirectory like /assets and then referencing that in Markdown: ![a screenshot example](/assets/screenshot.png). There's some more info on this over here: https://jekyllrb.com/docs/posts/#including-images-and-resources 🙂
Let me know how you go
So sorry - but don't work. the Directory Structure:
In the directory "_posts" is a markdown file "sample.md". In this file i link the Image "pic.jpg" from the Folder "images". How? There is no way that work. I habe no Problems, when the Markdown File is in the Root and i write a static link to "images/pic.jpg".
I read the Jeckyll Manual and i followed your link. But for my question there is no solution.
Thanks for letting me know @PeterGyger,
Let's check if adding a forward slash before the reference helps. For example:
If that doesn't help, let's check if adding ".." to before the first forward slash helps:
The path of the link in github markdown follow the linux convention, so the second example that give @ItsPugle should work. If not you can give to us the tree of the projects/repository and we can help in a better way.
There is another way to link image, using the absolute path like this:
You win :-)
I use the two dots and the Problem was solved.
Thank you very match for your kind help
You're more than welcome @PeterGyger!
If you need a hand with anything else, just let me know or feel free to post a new thread in the Conversations board 🌟
Have a great day!
I am also facing the issue for relative link. following the same structre as above , only diffence is i need to link .md file from _pages/ to _posts/.md.
i can see .md file https://aartirajput1.github.io/JekyllSiteRepo/JekyllSiteRepo/adding/ but not rendedered in HTML , its showing 404 error not found.
Thanks in advance :)
The nice thing about correcting the paths, rather than starting again re-adding your images if they have got 'lost', is that each individual image's attributes when originally placed in the file, its size, offset, whether the image has a frame around it, etc is kept next to the reference to the image. Adding a new image requires all of these attributes adding manually again.