Skip to content

Instantly share code, notes, and snippets.

@dylanwolff
Last active April 10, 2023 02:38
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save dylanwolff/46c43782f0db3d94f712 to your computer and use it in GitHub Desktop.
Save dylanwolff/46c43782f0db3d94f712 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