4

In a Jekyll post I want to include an image I have in the address images/posters/surfaces.png.

Furthermore, I want it to have a 750px width.

I tried <img src={images/posters/surfaces.png} alt="Poster" style="width: 750px;"/> and <img src="images/posters/surfaces.png" alt="Poster" style="width: 750px;"/> but it did not work.

What syntax should I use instead?

Jsevillamol
  • 2,425
  • 2
  • 23
  • 46

1 Answers1

1

Relative links lead to confusion, better use absolute URLs like:

 {{ "images/posters/surfaces.png" | absolute_url }}

Or if you won't use Jekyll in a subdirectory, just use /images/posters/surfaces.png (note the leading slash).

marcanuy
  • 23,118
  • 9
  • 64
  • 113