Store gallery photo names in datasets for easier iterating

This commit is contained in:
2016-01-24 20:45:03 +00:00
parent 9c9a498a32
commit 283317b3b9
93 changed files with 1249 additions and 83 deletions

View File

@@ -43,24 +43,23 @@
<body>
<section>
<h1>{{ page.title }}</h1>
{% for p in site.pages %}
{% if p.layout == 'gallery-photo' and p.gallery == page.gallery %}
{% include gallery-photos.html gallery=page.gallery %}
{% for photo in photos %}
<div class="photo" style="border-radius:2px;display:inline-block;margin:4px;overflow:hidden;">
{% assign maxsize = 0 %}
{% assign maxref = false %}
{% for size in p.sizes %}
{% if maxsize < size[1].height * size[1].width %}
{% assign maxsize = size[1].height * size[1].width %}
{% assign maxref = size %}
{% endif %}
{% endfor %}
<a href="{{ site.asset_prefix }}/gallery/{{ page.gallery }}/{{ p.name | remove:'.md' }}~{{ maxref[0] }}.jpg" data-size="{{ maxref[1].width }}x{{ maxref[1].height }}">
<img src="{{ site.asset_prefix }}/gallery/{{ page.gallery }}/{{ p.name | remove:'.md' }}~200x200.jpg" height="100" alt="{{ p.title }}" width="100" data-size="200x200" />
</a>
<div class="caption" style="display:none;">{{ p.content }}</div>
</div>
{% assign maxsize = 0 %}
{% assign maxref = false %}
{% for size in photo.sizes %}
{% if maxsize < size[1].height * size[1].width %}
{% assign maxsize = size[1].height * size[1].width %}
{% assign maxref = size %}
{% endif %}
{% endfor %}
<a href="{{ site.asset_prefix }}/gallery/{{ page.gallery }}/{{ photo.name | remove:'.md' }}~{{ maxref[0] }}.jpg" data-size="{{ maxref[1].width }}x{{ maxref[1].height }}">
<img src="{{ site.asset_prefix }}/gallery/{{ page.gallery }}/{{ photo.name | remove:'.md' }}~200x200.jpg" height="100" alt="{{ photo.title }}" width="100" data-size="200x200" />
</a>
<div class="caption" style="display:none;">{{ photo.content }}</div>
</div>
{% endfor %}
</section>
<!-- Root element of PhotoSwipe. Must have class pswp. -->