Generate all gallery and photo pages from yaml datafiles

This commit is contained in:
2016-01-26 15:02:42 +00:00
parent 3a0d77208f
commit d020903123
1367 changed files with 14792 additions and 32293 deletions

View File

@@ -0,0 +1,50 @@
---
layout: default
---
<section itemscope itemtype="http://schema.org/ImageGallery">
<header>
<div class="timeline"></div>
<h1>
<span itemprop="name">{{ page.title }}</span>
</h1>
</header>
<section class="post-content">
{{ content }}
{% if false != page.slideshow %}
<a href="slideshow.html">[ slideshow ]</a>
{% endif %}
{% if false != page.slideshow and page.map %}
&nbsp;|&nbsp;
{% endif %}
{% if page.map %}
<a href="map.html">[ map ]</a>
{% endif %}
{% assign items = site.array %}
{% for p in site.posts %}
{% if p.content contains page.gallery %}
{% assign items = items | push:p %}
{% endif %}
{% endfor %}
{% assign size=items | size %}
{% if size > 0 %}
<p>{{ site.mentioned_in }}</p>
<ul>
{% for item in items %}
<li><a href="{{ item.url }}">{{ item.title }}</a></li>
{% endfor %}
</ul>
{% endif %}
<div class="list-gallery">
{% for photo in page.photos %}
<span itemprop="image" itemscope itemtype="http://schema.org/Photograph">
<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" />
</a>
</span>
{% endfor %}
</div>
</section>
{% if false != page.comments %}
{% include disqus.html %}
{% endif %}
</section>

View File

@@ -1,43 +1,36 @@
---
title: Galleries
layout: default
---
{% assign url = page.url | split:'/' %}
{% assign gallery = url[2] %}
<section itemscope itemtype="http://schema.org/ImageGallery">
<header>
<div class="timeline"></div>
<h1>
<span itemprop="name">{{ page.title }}</span>
</h1>
</header>
<section class="post-content">
{{ content }}
{% if false != page.slideshow %}
<a href="slideshow.html">[ slideshow ]</a>
<section>
<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.
</p>
</section>
<section>
{% for gallery in page.galleries %}
{% if gallery.ignore == null %}
{% if gallery.highlight %}
{% assign highlight=gallery.highlight %}
{% else %}
{% assign photo=gallery.photos | first %}
{% assign highlight=photo.name %}
{% endif %}
{% if false != page.slideshow and page.map %}
&nbsp;|&nbsp;
{% endif %}
{% if page.map %}
<a href="map.html">[ map ]</a>
{% endif %}
{% assign items = site.array %}
{% for p in site.posts %}
{% if p.content contains gallery %}
{% assign items = items | push:p %}
{% endif %}
{% endfor %}
{% if items | size > 0 %}
<p>{{ site.mentioned_in }}</p>
<ul>
{% for item in items %}
<li><a href="{{ item.url }}">{{ item.title }}</a></li>
{% endfor %}
</ul>
{% endif %}
{% include gallery-list.html gallery=gallery %}
</section>
{% if false != page.comments %}
{% include disqus.html %}
<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;">
<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>
{% if gallery.date %}<br />
<small>
{% if gallery.date_end %}
{{ gallery.date|date:"%B %-d" }} &ndash; {{ gallery.date_end|date:"%-d" }}, {{ gallery.date|date:"%Y" }}
{% else %}
{{ gallery.date|date:"%B %-d, %Y" }}
{% endif %}
</small>
{% endif %}
</a>
</div>
{% endif %}
{% endfor %}
</section>

View File

@@ -19,8 +19,7 @@ layout: post
zoom : {{ page.map.zoom }}
}
);
{% include gallery-photos.html gallery=page.gallery %}
{% for photo in photos %}
{% for photo in page.photos %}
{% if photo.location %}
(function () {
var wo = false;
@@ -30,7 +29,7 @@ layout: post
title : "{{ photo.title }}"
});
var w = new google.maps.InfoWindow({
content: '<div style="margin-bottom:5px;">{{ photo.title|replace:"'","\\'" }}</div><a href="/{{ site.baseurl }}/{{ photo.url }}"><img alt="Photo: {{ photo.title | replace:"'","\\'" }}" height="200" src="{{ site.asset_prefix }}/gallery/{{ page.gallery }}/{{ photo.name | remove:'.md' }}~200x200.jpg" title="{{ photo.title|replace:"'","\\'" }}" width="200" /></a>'
content: '<div style="margin-bottom:5px;">{{ photo.title | replace:"'","\\'" }}</div><a href="/{{ site.baseurl }}/{{ photo.url }}"><img alt="Photo: {{ photo.title | replace:"'","\\'" }}" height="200" src="{{ site.asset_prefix }}/gallery/{{ page.gallery }}/{{ photo.name | remove:'.md' }}~200x200.jpg" title="{{ photo.title|replace:"'","\\'" }}" width="200" /></a>'
});
google.maps.event.addListener(
m,

View File

@@ -1,14 +1,15 @@
---
layout: default
---
{% assign photo=page.photo %}
<section itemscope itemtype="http://schema.org/Photograph">
<header>
<div class="timeline">
{% 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>
{% 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>
{% endif %}
{% if page.location %}
<a href="https://maps.google.com/maps?hl=en&amp;ll={{ page.location.latitude }},{{ page.location.longitude }}&amp;t=w&amp;z=12"><img alt="map" height="49" src="https://maps.googleapis.com/maps/api/staticmap?center={{ page.location.latitude }},{{ page.location.longitude }}&amp;zoom=9&amp;size=98x98&amp;sensor=false" title="{{ page.location.title }}" width="49" /></a>
{% if photo.location %}
<a href="https://maps.google.com/maps?hl=en&amp;ll={{ photo.location.latitude }},{{ photo.location.longitude }}&amp;t=w&amp;z=12"><img alt="map" height="49" src="https://maps.googleapis.com/maps/api/staticmap?center={{ photo.location.latitude }},{{ photo.location.longitude }}&amp;zoom=9&amp;size=98x98&amp;sensor=false" title="{{ photo.location.title }}" width="49" /></a>
{% endif %}
</div>
<section class="post-content">
@@ -16,33 +17,33 @@ layout: default
<a href="/{{ site.baseurl }}/gallery/{{ page.gallery }}/">[ list ]</a>
</section>
<ul style="margin-top:0;">
{% if page.previous %}
<li><a href="/{{ site.baseurl }}/gallery/{{ page.gallery }}/{{ page.previous }}.html" rel="prev">&nbsp;&larr;&nbsp;</a></li>
{% if photo.previous %}
<li><a href="/{{ site.baseurl }}/gallery/{{ page.gallery }}/{{ photo.previous }}.html" rel="prev">&nbsp;&larr;&nbsp;</a></li>
{% else %}
<li><span class="noanchor">&nbsp;&larr;&nbsp;</span></li>
{% endif %}
{% if page.next %}
<li><a href="/{{ site.baseurl }}/gallery/{{ page.gallery }}/{{ page.next }}.html" rel="next">&nbsp;&rarr;&nbsp;</a></li>
{% if photo.next %}
<li><a href="/{{ site.baseurl }}/gallery/{{ page.gallery }}/{{ photo.next }}.html" rel="next">&nbsp;&rarr;&nbsp;</a></li>
{% else %}
<li><span class="noanchor">&nbsp;&rarr;&nbsp;</span></li>
{% endif %}
</ul>
<h1>
<span itemprop="name">{{ page.title }}</span>
<span itemprop="name">{{ photo.title }}</span>
</h1>
</header>
<section class="post-content">
{% assign maxsize = 0 %}
{% assign maxref = false %}
{% for size in page.sizes %}
{% 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 %}
<p style="text-align:center;">
<a href="{{ site.asset_prefix }}{{ page.url|replace:".html","" }}~{{ maxref[0] }}.jpg"><img alt="Photo: {{ page.title }}" src="{{ site.asset_prefix }}{{ page.url|replace:".html","~640w.jpg" }}" style="max-width:630px;" /></a>
<a href="{{ site.asset_prefix }}/{{ photo.url|replace:".html","" }}~{{ maxref[0] }}.jpg"><img alt="Photo: {{ photo.title }}" src="{{ site.asset_prefix }}/{{ photo.url|replace:".html","~640w.jpg" }}" style="max-width:630px;" /></a>
</p>
{% if content %}
@@ -56,32 +57,32 @@ layout: default
<div style="float:left;width:352px;">
<dl style="margin-top:0;">
<dt>Date</dt>
<dd itemprop="dateCreated" content="{{ page.date|date:'%FT%TZ' }}">{{ page.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 page.aperture %}
{% if photo.aperture %}
<dt>Camera</dt>
<dd>{{ page.make }} {{ page.model }}</dd>
<dd>{{ photo.make }} {{ photo.model }}</dd>
{% endif %}
{% if page.aperture %}
{% if photo.aperture %}
<dt>Aperture</dt>
<dd>{{ page.aperture }}</dd>
<dd>{{ photo.aperture }}</dd>
{% endif %}
{% if page.aperture %}
{% if photo.aperture %}
<dt>Exposure</dt>
<dd>{{ page.exposure }}</dd>
<dd>{{ photo.exposure }}</dd>
{% endif %}
{% if page.sizes %}
{% if photo.sizes %}
<dt>Sizes</dt>
<dd>
{% for size in page.sizes %}
{% for size in photo.sizes %}
{% if 0 < forloop.index0 %}&nbsp;&middot;&nbsp;{% endif %}
<span itemprop="image" itemscope itemtype="http://schema.org/ImageObject">
<meta itemprop="height" content="{{ size[1].height }}" />
<meta itemprop="width" content="{{ size[1].width }}" />
<a href="{{ site.asset_prefix }}{{ page.url|replace:".html","" }}~{{ size[0] }}.jpg" itemprop="contentUrl">{{ size[1].width }}x{{size[1].height }}</a>
<a href="{{ site.asset_prefix }}{{ photo.url|replace:".html","" }}~{{ size[0] }}.jpg" itemprop="contentUrl">{{ size[1].width }}x{{size[1].height }}</a>
</span>
{% endfor %}
</dd>
@@ -89,28 +90,28 @@ layout: default
</dl>
</div>
{% if page.location %}
{% if photo.location %}
<div style="float:left;line-height:0;margin-left:7px;width:280px;" itemprop="contentLocation" itemscope itemtype="http://schema.org/Place">
<span itemprop="geo" itemscope itemtype="http://schema.org/GeoCoordinates">
<meta itemprop="latitude" content="{{ page.location.latitude }}" />
<meta itemprop="longitude" content="{{ page.location.longitude }}" />
<meta itemprop="latitude" content="{{ photo.location.latitude }}" />
<meta itemprop="longitude" content="{{ photo.location.longitude }}" />
</span>
<a href="https://maps.google.com/maps?hl=en&amp;ll={{ page.location.latitude }},{{ page.location.longitude }}&amp;t=w&amp;z=12"><img alt="map" height="173" src="https://maps.googleapis.com/maps/api/staticmap?center={{ page.location.latitude }},{{ page.location.longitude }}&amp;zoom=13&amp;size=280x173&amp;markers=size:mid%7Ccolor:orange%7C{{ page.location.latitude }},{{ page.location.longitude }}&amp;sensor=false" title="{{ page.location.title }}" width="280" /></a>
<a href="https://maps.google.com/maps?hl=en&amp;ll={{ photo.location.latitude }},{{ photo.location.longitude }}&amp;t=w&amp;z=12"><img alt="map" height="173" src="https://maps.googleapis.com/maps/api/staticmap?center={{ photo.location.latitude }},{{ photo.location.longitude }}&amp;zoom=13&amp;size=280x173&amp;markers=size:mid%7Ccolor:orange%7C{{ photo.location.latitude }},{{ photo.location.longitude }}&amp;sensor=false" title="{{ photo.location.title }}" width="280" /></a>
</div>
{% endif %}
<div style="clear:left;"></div>
</div>
<div class="meta-navigate screen-only">
{% if page.next %}
{% if photo.next %}
<div style="float:right;">
<a href="/{{ site.baseurl }}/gallery/{{ page.gallery }}/{{ page.next }}.html" rel="next">Next Photo &raquo;</a>
<a href="/{{ site.baseurl }}/gallery/{{ page.gallery }}/{{ photo.next }}.html" rel="next">Next Photo &raquo;</a>
</div>
{% endif %}
{% if page.previous %}
{% if photo.previous %}
<div style="float:left;">
<a href="/{{ site.baseurl }}/gallery/{{ page.gallery }}/{{ page.previous }}.html" rel="prev">&laquo; Previous</a>
<a href="/{{ site.baseurl }}/gallery/{{ page.gallery }}/{{ photo.previous }}.html" rel="prev">&laquo; Previous</a>
</div>
{% endif %}

View File

@@ -1,4 +1,3 @@
{% assign item = site.gallery | where:'name', page.gallery | first %}
<html>
<head>
<title>{{ page.title }}</title>
@@ -43,8 +42,7 @@
<body>
<section>
<h1>{{ page.title }}</h1>
{% include gallery-photos.html gallery=page.gallery %}
{% for photo in photos %}
{% 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 %}