peterdesmet / petridish

Jekyll theme for research project websites 🧫
https://peterdesmet.github.io/petridish
MIT License
53 stars 44 forks source link

Use "alt" of image as image caption #29

Closed peterdesmet closed 5 years ago

peterdesmet commented 5 years ago

Captions of images currently have to be written below the image, with no guarantee that they'll display nicely (e.g. they are not part of the same paragraph). Would be nice that cf. RMarkdown captions are taken from the image "alt":

![Description of image](image.jpg)
<p>
  <img src="image.jpg">
  <em class="d-block">Description of image</em>
</p>

Note: also look how RMarkdown styles this.

peterdesmet commented 5 years ago

Decided not to implement it as such, because it doesn't allow to include Markdown in your caption (e.g. a link to a paper where the image is from).

peterdesmet commented 5 years ago

Implemented as image directly followed by em text. See https://github.com/peterdesmet/petridish/commit/5922516a22282b3f3a29c0ed25afb5d2715a6e1e