Selaa lähdekoodia

Add sort criterion to images

Danilo Gómez Gómez 4 vuotta sitten
vanhempi
commit
01d2244322
3 muutettua tiedostoa jossa 3 lisäystä ja 1 poistoa
  1. 1 1
      layout/work.html
  2. 1 0
      layout/work/illustration.html
  3. 1 0
      layout/work/poster.html

+ 1 - 1
layout/work.html

@@ -8,7 +8,7 @@
 {% endblock %}
 
 {% block main %}
-{% for image in images(path) %}
+{% for image in (sorted(images(path), reverse=True) if sort_images else images(path)) %}
 	<figure class="{{ 'clickable-fig' if expand_dialog else ''}}">
 		<img class="tile" src="{{ (image.main or image.filenames[0]) | static }}" alt="{{ image.category }}: {{ image.name }} ({{ image.year }})">
 		<figcaption class="hbox">

+ 1 - 0
layout/work/illustration.html

@@ -2,6 +2,7 @@
 
 {% set illustration_selected = True %}
 {% set work_path = "illustration" %}
+{% set sort_images = True %}
 
 {% block style %}
 :root {

+ 1 - 0
layout/work/poster.html

@@ -3,3 +3,4 @@
 {% set poster_selected = True %}
 {% set work_path = "poster" %}
 {% set expand_dialog = True %}
+{% set sort_images = True %}