Skip to content

Instantly share code, notes, and snippets.

@tuksik
Forked from dylanwolff/Markdown image captions
Created November 12, 2016 17:11
Show Gist options
  • Save tuksik/11887bc554f39d23b2626ba78ecf32cd to your computer and use it in GitHub Desktop.
Save tuksik/11887bc554f39d23b2626ba78ecf32cd to your computer and use it in GitHub Desktop.
## _includes/image.html
<div class="image-wrapper" >
{% if include.url %}
<a href="{{ include.url }}" title="{{ include.title }}" target="_blank">
{% endif %}
<img src="{{ site.url }}/{{ include.img }}" alt="{{ include.title }}"/>
{% if include.url %}
</a>
{% endif %}
{% if include.caption %}
<p class="image-caption">{{ include.caption }}</p>
{% endif %}
</div>
## Include the image in your post and specify a caption with this tag
{% include image.html img="assets/images/image_file" title="" caption="" %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment