jekyll-postfiles icon indicating copy to clipboard operation
jekyll-postfiles copied to clipboard

Hard link to image does not work on index page

Open DirtyF opened this issue 7 years ago • 3 comments

Hi,

I tested your plugin and I found out what looks like an incorrect behavior:

Given that I have a link to an image in the same folder than the post
When I launch `jekyll build`
Then link to image in `index.html` is generated as `src="/my-image.png"`
And link to image in article is generated as `src="/2017/10/03/my-image.png"`
# index.html displaying a loop of full content of posts with pagination (1 per page)
...
{{ post.content }}
...
# _posts/2017/10/03/my-article.md

![Alternative text](my-image.png)

DirtyF avatar Oct 03 '17 14:10 DirtyF

I suppose we would need to add the relative path to the image URL after Kramdown parsed the source, but I really don't know how/where to do it.

nhoizey avatar Oct 04 '17 12:10 nhoizey

sample problem, seems no solution?

michalliu avatar Nov 16 '18 09:11 michalliu

Well I have a solution, reference your image like this ![Example]({{ page.url }}your-image.png)

michalliu avatar Nov 16 '18 09:11 michalliu