Image caption in Jekyll

Ronalds Vilcins
1 min readSep 24, 2019

--

If you don’t want to use any plugins (which means you can push it to GitHub directly without generating the site first), you can create a new file named image.html in _includes:

<figure class="image">
<img src="{{ include.url }}" alt="{{ include.description }}">
<figcaption>{{ include.description }}</figcaption>
</figure>

Display the image from your markdown with:

{% include image.html url="/images/bird.jpg" description="Bird" %}

--

--

Ronalds Vilcins

I drink a lot of tea and build beautiful websites. If you are looking to work together or just start a conversation 👉 https://www.ronaldsvilcins.com/