Skip to content

Instantly share code, notes, and snippets.

@bpatra
Last active December 27, 2020 22:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bpatra/56d9f3085f13d85de6b80b95bd4e0b9d to your computer and use it in GitHub Desktop.
Save bpatra/56d9f3085f13d85de6b80b95bd4e0b9d to your computer and use it in GitHub Desktop.
Image Caption for Image in Personal Blog Posts
<figure class="centered-figure {{ include.size_class }} {{ include.position_class }}">
{% if include.title %}
{% assign title = include.title %}
{% else %}
{% assign title = include.caption %}
{% endif %}
<img src="{{ include.imageurl }}" alt="{{ title }}" />
{% if include.caption %}
<figcaption class="caption-text">{{ include.caption }}</figcaption>
{% endif %}
</figure>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment