Fix problem in gallery generator plugin

This commit is contained in:
2016-06-05 21:25:51 +01:00
parent c3affdd0c3
commit 3a7a11e6cf
3 changed files with 238 additions and 240 deletions

View File

@@ -1,59 +1,58 @@
--- ---
layout: default layout: default
--- ---
<section itemscope itemtype="http://schema.org/ImageGallery"> <section itemscope itemtype="http://schema.org/ImageGallery">
<header> <header>
<div class="timeline"> <div class="timeline">
{% if page.date %} {% if page.date %}
<time datetime="{{ page.date | date_to_xmlschema }}" title="{{ page.date | date_to_xmlschema }}"><strong>{{ page.date|date:"%b %d"|upcase }}</strong><br />{{ page.date|date:"%Y" }}</time> <time datetime="{{ page.date | date_to_xmlschema }}" title="{{ page.date | date_to_xmlschema }}"><strong>{{ page.date|date:"%b %d"|upcase }}</strong><br />{{ page.date|date:"%Y" }}</time>
{% endif %} {% endif %}
</div> </div>
<h1> <h1>
<a href="/{{ site.baseurl }}{{ page.url }}"><span itemprop="name">{{ page.title }}</span></a> <a href="/{{ site.baseurl }}{{ page.url }}"><span itemprop="name">{{ page.title }}</span></a>
<small class="print-only" itemprop="datePublished" content="{{ page.date|date:'%F') }}">{{ page.date|date:'%A, %B %d, %Y' }}</small> <small class="print-only" itemprop="datePublished" content="{{ page.date|date:'%F') }}">{{ page.date|date:'%A, %B %d, %Y' }}</small>
</h1> </h1>
{% if page.end_date %} {% if page.end_date %}
<span class="date-range">&#x1f557; {{ page.date | date:"%d/%m/%Y" }} - {{ page.end_date | date:"%d/%m/%Y" }}</span> <span class="date-range">&#x1f557; {{ page.date | date:"%d/%m/%Y" }} - {{ page.end_date | date:"%d/%m/%Y" }}</span>
{% endif %} {% endif %}
</header> </header>
<section class="post-content"> <section class="post-content">
{{ content }} {% if false != page.slideshow %}
{% if false != page.slideshow %} <a href="slideshow.html">[ slideshow ]</a>
<a href="slideshow.html">[ slideshow ]</a> {% endif %}
{% endif %} {% if false != page.slideshow and page.map %}
{% if false != page.slideshow and page.map %} &nbsp;|&nbsp;
&nbsp;|&nbsp; {% endif %}
{% endif %} {% if page.map %}
{% if page.map %} <a href="map.html">[ map ]</a>
<a href="map.html">[ map ]</a> {% endif %}
{% endif %} {% assign items = ''|split:'' %}
{% assign items = ''|split:'' %} {% for p in site.posts %}
{% for p in site.posts %} {% if p.content contains page.gallery %}
{% if p.content contains page.gallery %} {% assign items = items | push:p %}
{% assign items = items | push:p %} {% endif %}
{% endif %} {% endfor %}
{% endfor %} {% assign size=items | size %}
{% assign size=items | size %} {% if size > 0 %}
{% if size > 0 %} <p>{{ site.mentioned_in }}</p>
<p>{{ site.mentioned_in }}</p> <ul>
<ul> {% for item in items %}
{% for item in items %} <li><a href="{{ item.url }}">{{ item.title }}</a></li>
<li><a href="{{ item.url }}">{{ item.title }}</a></li> {% endfor %}
{% endfor %} </ul>
</ul> {% endif %}
{% endif %} <div class="list-gallery">
<div class="list-gallery"> {% for photo in page.photos %}
{% for photo in page.photos %} <span itemprop="image" itemscope itemtype="http://schema.org/Photograph">
<span itemprop="image" itemscope itemtype="http://schema.org/Photograph"> <a href="/{{ site.baseurl }}/{{ photo.url }}" itemprop="url">
<a href="/{{ site.baseurl }}/{{ photo.url }}" itemprop="url"> <img alt="Photo: {{ photo.title }}" height="200" src="{{ site.asset_prefix }}/gallery/{{ page.gallery }}/{{ photo.name }}~200x200.jpg" title="{{ photo.title }}" width="200" />
<img alt="Photo: {{ photo.title }}" height="200" src="{{ site.asset_prefix }}/gallery/{{ page.gallery }}/{{ photo.name }}~200x200.jpg" title="{{ photo.title }}" width="200" /> </a>
</a> </span>
</span> {% endfor %}
{% endfor %} </div>
</div> </section>
</section> {% if page.comments != false %}
{% if page.comments != false %} {% include disqus.html %}
{% include disqus.html %} {% endif %}
{% endif %}
</section> </section>

View File

@@ -1,36 +1,36 @@
--- ---
title: Galleries title: Galleries
layout: default layout: default
--- ---
<section> <section>
<p> <p>
Naast foto's die bij bepaalde activiteiten horen, kom ik vaak situaties tegen die ik de moeite waard vind om op beeld vast te leggen. Wist je dat ik de meeste foto's op dit blog met de camera op mijn HTC One S of OnePlus One maak? Geloof het of niet, maar zelfs sommige van de prachtige panorama's boven elke pagina zijn daarvan afkomstig. Natuurlijk vul ik mijn eigen foto's aan met exemplaren van anderen. Naast foto's die bij bepaalde activiteiten horen, kom ik vaak situaties tegen die ik de moeite waard vind om op beeld vast te leggen. Wist je dat ik de meeste foto's op dit blog met de camera op mijn HTC One S of OnePlus One maak? Geloof het of niet, maar zelfs sommige van de prachtige panorama's boven elke pagina zijn daarvan afkomstig. Natuurlijk vul ik mijn eigen foto's aan met exemplaren van anderen.
</p> </p>
</section> </section>
<section> <section>
{% for gallery in page.galleries %} {% for gallery in page.galleries %}
{% unless gallery.ignore %} {% unless gallery.ignore %}
{% if gallery.highlight %} {% if gallery.highlight %}
{% assign highlight=gallery.highlight %} {% assign highlight=gallery.highlight %}
{% else %} {% else %}
{% assign photo=gallery.photos | first %} {% assign photo=gallery.photos | first %}
{% assign highlight=photo.name %} {% assign highlight=photo.name %}
{% endif %} {% endif %}
<div style="display: inline-block; height: 274px; margin: 8px 10px 0 0; text-align: center; width: 200px;"> <div style="display: inline-block; height: 274px; margin: 8px 10px 0 0; text-align: center; width: 200px;">
<a href="/{{ site.baseurl }}/gallery/{{ gallery.gallery }}/" style="text-decoration:none;"> <a href="/{{ site.baseurl }}/gallery/{{ gallery.gallery }}/" style="text-decoration:none;">
<img alt="{{ gallery.title }}" height="200" src="{{ site.asset_prefix }}/gallery/{{ gallery.gallery }}/{{ highlight }}~200x200.jpg" title="{{ gallery.title }}" width="200" style="border-radius:4px;" /> <img alt="{{ gallery.title }}" height="200" src="{{ site.asset_prefix }}/gallery/{{ gallery.gallery }}/{{ highlight }}~200x200.jpg" title="{{ gallery.title }}" width="200" style="border-radius:4px;" />
<span style="text-decoration:underline;">{{ gallery.title }}</span> <span style="text-decoration:underline;">{{ gallery.title }}</span>
{% if gallery.date %}<br /> {% if gallery.date %}<br />
<small> <small>
{% if gallery.date_end %} {% if gallery.date_end %}
{{ gallery.date | date:"%B %-d" }} &ndash; {{ gallery.date_end | date:"%-d" }}, {{ gallery.date | date:"%Y" }} {{ gallery.date | date:"%B %-d" }} &ndash; {{ gallery.date_end | date:"%-d" }}, {{ gallery.date | date:"%Y" }}
{% else %} {% else %}
{{ gallery.date | date:"%B %-d, %Y" }} {{ gallery.date | date:"%B %-d, %Y" }}
{% endif %} {% endif %}
</small> </small>
{% endif %} {% endif %}
</a> </a>
</div> </div>
{% endunless %} {% endunless %}
{% endfor %} {% endfor %}
</section> </section>

View File

@@ -1,147 +1,146 @@
--- ---
layout: default layout: default
--- ---
{% assign photo=page.photo %} {% assign photo=page.photo %}
{% capture photo_url %}{{ site.asset_prefix }}/gallery/{{ page.gallery }}/{{ photo.name }}{% endcapture %} {% capture photo_url %}{{ site.asset_prefix }}/gallery/{{ page.gallery }}/{{ photo.name }}{% endcapture %}
{% capture gallery_url %}/{{ site.baseurl }}/gallery/{{ page.gallery }}{% endcapture %} {% capture gallery_url %}/{{ site.baseurl }}/gallery/{{ page.gallery }}{% endcapture %}
<section itemscope itemtype="http://schema.org/Photograph"> <section itemscope itemtype="http://schema.org/Photograph">
<header> <header>
<div class="timeline"> <div class="timeline">
{% if photo.date %} {% if photo.date %}
<time datetime="{{ photo.date | date_to_xmlschema }}" title="{{ photo.date | date_to_xmlschema }}"><strong>{{ photo.date | date:"%b %d" | upcase }}</strong><br />{{ photo.date | date:"%Y" }}</time> <time datetime="{{ photo.date | date_to_xmlschema }}" title="{{ photo.date | date_to_xmlschema }}"><strong>{{ photo.date | date:"%b %d" | upcase }}</strong><br />{{ photo.date | date:"%Y" }}</time>
{% endif %} {% endif %}
{% if photo.latitude %} {% if photo.latitude %}
<a href="https://maps.google.com/maps?hl=en&amp;ll={{ photo.latitude }},{{ photo.longitude }}&amp;t=w&amp;z=12"><img alt="map" height="49" src="https://maps.googleapis.com/maps/api/staticmap?center={{ photo.latitude }},{{ photo.longitude }}&amp;zoom=9&amp;size=98x98&amp;sensor=false" title="{{ photo.title }}" width="49" /></a> <a href="https://maps.google.com/maps?hl=en&amp;ll={{ photo.latitude }},{{ photo.longitude }}&amp;t=w&amp;z=12"><img alt="map" height="49" src="https://maps.googleapis.com/maps/api/staticmap?center={{ photo.latitude }},{{ photo.longitude }}&amp;zoom=9&amp;size=98x98&amp;sensor=false" title="{{ photo.title }}" width="49" /></a>
{% endif %} {% endif %}
</div> </div>
<section class="post-content"> <section class="post-content">
<p>{{ content }}</p> <a href="{{ gallery_url }}/">[ gallery ]</a>
<a href="{{ gallery_url }}/">[ gallery ]</a> </section>
</section> <ul style="margin-top: 0;">
<ul style="margin-top: 0;"> {% if photo.previous %}
{% if photo.previous %} <li><a href="{{ gallery_url }}/{{ photo.previous }}.html" rel="prev">&nbsp;&larr;&nbsp;</a></li>
<li><a href="{{ gallery_url }}/{{ photo.previous }}.html" rel="prev">&nbsp;&larr;&nbsp;</a></li> {% else %}
{% else %} <li><span class="noanchor">&nbsp;&larr;&nbsp;</span></li>
<li><span class="noanchor">&nbsp;&larr;&nbsp;</span></li> {% endif %}
{% endif %}
{% if photo.next %}
{% if photo.next %} <li><a href="{{ gallery_url }}/{{ photo.next }}.html" rel="next">&nbsp;&rarr;&nbsp;</a></li>
<li><a href="{{ gallery_url }}/{{ photo.next }}.html" rel="next">&nbsp;&rarr;&nbsp;</a></li> {% else %}
{% else %} <li><span class="noanchor">&nbsp;&rarr;&nbsp;</span></li>
<li><span class="noanchor">&nbsp;&rarr;&nbsp;</span></li> {% endif %}
{% endif %} </ul>
</ul> <h1>
<h1> <span itemprop="name">{{ photo.title }}</span>
<span itemprop="name">{{ photo.title }}</span> </h1>
</h1> </header>
</header> <section class="post-content">
<section class="post-content"> {% if photo.width %}
{% if photo.width %} {% assign max_width=photo.width %}
{% assign max_width=photo.width %} {% else %}
{% else %} {% assign max_width=640 %}
{% assign max_width=640 %} {% endif %}
{% endif %} {% assign sizes=''|split:'' %}
{% assign sizes=''|split:'' %} {% for size in site.photo_sizes %}
{% for size in site.photo_sizes %} {% if size[0] <= max_width %}
{% if size[0] <= max_width %} {% assign sizes=sizes | push:size %}
{% assign sizes=sizes | push:size %} {% endif %}
{% endif %} {% endfor %}
{% endfor %} {% if photo.width == 200 %}
{% if photo.width == 200 %} {% assign file='200x200' %}
{% assign file='200x200' %} {% else %}
{% else %} {% assign file='640w' %}
{% assign file='640w' %} {% endif %}
{% endif %} <p style="text-align: center;">
<p style="text-align: center;"> <a href="{{ photo_url }}~{{ file }}.jpg"><img alt="Photo: {{ photo.title }}" src="{{ photo_url }}~{{ file }}.jpg" style="max-width:630px;" /></a>
<a href="{{ photo_url }}~{{ file }}.jpg"><img alt="Photo: {{ photo.title }}" src="{{ photo_url }}~{{ file }}.jpg" style="max-width:630px;" /></a> </p>
</p>
{% if photo.description %}
{% if photo.description %} <div itemprop="description">
<div itemprop="description"> {{ photo.description }}
{{ photo.description }} </div>
</div> {% endif %}
{% endif %} </section>
</section> <div class="meta">
<div class="meta"> <div class="meta-properties">
<div class="meta-properties"> <div>
<div> <dl style="margin-top:0;">
<dl style="margin-top:0;"> <dt>Date</dt>
<dt>Date</dt> <dd itemprop="dateCreated" content="{{ photo.date | date:'%FT%TZ' }}">{{ photo.date | date:'%A, %B %d at %I:%M %p' | replace:' 0',' ' | replace:' AM',' am' | replace:' PM',' pm' }}
<dd itemprop="dateCreated" content="{{ photo.date | date:'%FT%TZ' }}">{{ photo.date | date:'%A, %B %d at %I:%M %p' | replace:' 0',' ' | replace:' AM',' am' | replace:' PM',' pm' }}
{% if photo.aperture %}
{% if photo.aperture %} <dt>Camera</dt>
<dt>Camera</dt> <dd>{{ photo.make }} {{ photo.model }}</dd>
<dd>{{ photo.make }} {{ photo.model }}</dd> {% endif %}
{% endif %}
{% if photo.aperture %}
{% if photo.aperture %} <dt>Aperture</dt>
<dt>Aperture</dt> <dd>{{ photo.aperture }}</dd>
<dd>{{ photo.aperture }}</dd> {% endif %}
{% endif %}
{% if photo.aperture %}
{% if photo.aperture %} <dt>Exposure</dt>
<dt>Exposure</dt> <dd>{{ photo.exposure }}</dd>
<dd>{{ photo.exposure }}</dd> {% endif %}
{% endif %}
{% if sizes %}
{% if sizes %} <dt>Sizes</dt>
<dt>Sizes</dt> <dd>
<dd> {% for size in sizes %}
{% for size in sizes %} {% if 0 < forloop.index0 %}&nbsp;&middot;&nbsp;{% endif %}
{% if 0 < forloop.index0 %}&nbsp;&middot;&nbsp;{% endif %} {% assign width=size[0] %}
{% assign width=size[0] %} {% assign height=size[1] %}
{% assign height=size[1] %} {% capture label %}{{ width }}x{{ height }}{% endcapture %}
{% capture label %}{{ width }}x{{ height }}{% endcapture %} {% if width == 640 %}
{% if width == 640 %} {% assign label='640' %}
{% assign label='640' %} {% assign file='640w' %}
{% assign file='640w' %} {% else %}
{% else %} {% capture label %}{{ width }}x{{ height }}{% endcapture %}
{% capture label %}{{ width }}x{{ height }}{% endcapture %} {% assign file=label %}
{% assign file=label %} {% endif %}
{% endif %} <span itemprop="image" itemscope itemtype="http://schema.org/ImageObject">
<span itemprop="image" itemscope itemtype="http://schema.org/ImageObject"> <meta itemprop="width" content="{{ width }}" />
<meta itemprop="width" content="{{ width }}" /> {% if height > 0 %}
{% if height > 0 %} <meta itemprop="height" content="{{ height }}" />
<meta itemprop="height" content="{{ height }}" /> {% endif %}
{% endif %} <a href="{{ photo_url }}~{{ file }}.jpg" itemprop="contentUrl">{{ label }}</a>
<a href="{{ photo_url }}~{{ file }}.jpg" itemprop="contentUrl">{{ label }}</a> </span>
</span> {% endfor %}
{% endfor %} </dd>
</dd> {% endif %}
{% endif %} </dl>
</dl> </div>
</div>
{% if photo.latitude %}
{% if photo %} <div class="map" itemprop="contentLocation" itemscope itemtype="http://schema.org/Place">
<div class="map" itemprop="contentLocation" itemscope itemtype="http://schema.org/Place"> <span itemprop="geo" itemscope itemtype="http://schema.org/GeoCoordinates">
<span itemprop="geo" itemscope itemtype="http://schema.org/GeoCoordinates"> <meta itemprop="latitude" content="{{ photo.latitude }}" />
<meta itemprop="latitude" content="{{ photo.latitude }}" /> <meta itemprop="longitude" content="{{ photo.longitude }}" />
<meta itemprop="longitude" content="{{ photo.longitude }}" /> </span>
</span> <a href="https://maps.google.com/maps?hl=en&amp;ll={{ photo.latitude }},{{ photo.longitude }}&amp;t=w&amp;z=12"><img alt="map" height="173" src="https://maps.googleapis.com/maps/api/staticmap?center={{ photo.latitude }},{{ photo.longitude }}&amp;zoom=13&amp;size=280x173&amp;markers=size:mid%7Ccolor:orange%7C{{ photo.latitude }},{{ photo.longitude }}&amp;sensor=false" title="{{ photo.title }}" width="280" /></a>
<a href="https://maps.google.com/maps?hl=en&amp;ll={{ photo.latitude }},{{ photo.longitude }}&amp;t=w&amp;z=12"><img alt="map" height="173" src="https://maps.googleapis.com/maps/api/staticmap?center={{ photo.latitude }},{{ photo.longitude }}&amp;zoom=13&amp;size=280x173&amp;markers=size:mid%7Ccolor:orange%7C{{ photo.latitude }},{{ photo.longitude }}&amp;sensor=false" title="{{ photo.title }}" width="280" /></a> </div>
</div> {% endif %}
{% endif %}
<div style="clear:left;"></div>
<div style="clear:left;"></div> </div>
</div> <div class="meta-navigate screen-only">
<div class="meta-navigate screen-only"> {% if photo.next %}
{% if photo.next %} <div style="float:right;">
<div style="float:right;"> <a href="{{ gallery_url }}/{{ photo.next }}.html" rel="next">Next &raquo;</a>
<a href="{{ gallery_url }}/{{ photo.next }}.html" rel="next">Next &raquo;</a> </div>
</div> {% endif %}
{% endif %}
{% if photo.previous %}
{% if photo.previous %} <div style="float:left;">
<div style="float:left;"> <a href="{{ gallery_url }}/{{ photo.previous }}.html" rel="prev">&laquo; Previous</a>
<a href="{{ gallery_url }}/{{ photo.previous }}.html" rel="prev">&laquo; Previous</a> </div>
</div> {% endif %}
{% endif %}
<div style="padding:0 120px;">
<div style="padding:0 120px;"> <a href="./" rel="contents">Gallery List</a>
<a href="./" rel="contents">Gallery List</a> </div>
</div>
<div style="clear:both;"></div>
<div style="clear:both;"></div> </div>
</div> </div>
</div> </section>
</section>