add gallery feature (wip)

This commit is contained in:
rzen
2020-08-31 21:06:29 -04:00
parent 3277740d45
commit 80d69fc179
12 changed files with 83 additions and 8 deletions

8
_includes/gallery.html Normal file
View File

@ -0,0 +1,8 @@
{% assign images = (include.images | split: "|") %}
{% assign thumbnails = (include.thumbnails | split: "|") %}
<div class="gallery">
{% for image in images %}
<a href="{{ include.dir }}/{{ image }}"><img src="{{ include.dir }}/{{ image }}" /></a>
{% endfor %}
</div>

View File

@ -11,9 +11,16 @@
{% capture alt %}alt="{{ alt }}" title="{{ alt }}"{% endcapture %}
{% endif %}
{% assign frame=include.frame | default: true %}
{% assign frame=include.frame %}
{% if frame == blank %}
{% assign frame=true %}
{% endif %}
<figure class="figure {% if include.caption %}caption{% endif %} {% if frame %}frame{% endif %}">
<a target="_blank" href="{{ imagePath }}"><img {{ src }} {{ alt }} width="100%" /></a>
{% if include.width != blank %}
{% capture width %}style="width:{{ include.width }}"{% endcapture %}
{% endif %}
<figure {{width}} class="figure {% if include.caption %}caption{% endif %} {% if frame %}frame{% endif %}">
<a target="_blank" href="{{ imagePath }}"><img {{ src }} {{ alt }} /></a>
{% if caption != blank %}<figcaption>{{ caption }}</figcaption>{% endif %}
</figure>