Simply gallery data files, only keep maximum width per photo, keep 640w compatibility
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{{ page.title }}</title>
|
||||
@@ -44,16 +45,26 @@
|
||||
<h1>{{ page.title }}</h1>
|
||||
{% for photo in page.photos %}
|
||||
<div class="photo" style="border-radius:2px;display:inline-block;margin:4px;overflow:hidden;">
|
||||
{% 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 %}
|
||||
{% capture photo_url %}{{ site.asset_prefix }}/gallery/{{ page.gallery }}/{{ photo.name }}{% endcapture %}
|
||||
{% if photo.width %}
|
||||
{% assign width=photo.width %}
|
||||
{% else %}
|
||||
{% assign width=640 %}
|
||||
{% endif %}
|
||||
{% assign sizes=''|split:'' %}
|
||||
{% for size in site.photo_sizes %}
|
||||
{% if size[0] == width %}
|
||||
{% assign height=size[1] %}
|
||||
{% 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" />
|
||||
{% endfor %}
|
||||
{% capture label %}{{ width }}x{{ height }}{% endcapture %}
|
||||
{% if width == 640 %}
|
||||
{% assign file='640w' %}
|
||||
{% else %}
|
||||
{% assign file=label %}
|
||||
{% endif %}
|
||||
<a href="{{ photo_url }}~{{ file }}.jpg" data-size="{{ label }}">
|
||||
<img src="{{ photo_url }}~200x200.jpg" height="100" alt="{{ photo.title }}" width="100" data-size="200x200" />
|
||||
</a>
|
||||
<div class="caption" style="display:none;">{{ photo.content }}</div>
|
||||
</div>
|
||||
@@ -184,4 +195,4 @@
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
Reference in New Issue
Block a user