From cf0669ebd4563144c1ba50f62fe71fe6139e7037 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Mon, 11 Jul 2022 23:15:22 +0300 Subject: Improve gallery sorting behaviour --- _gallery/01-testigalleria.json | 17 ----------------- _gallery/02-otsikoton-galleria.json | 22 ---------------------- src/admin/config.yml | 9 ++++----- src/index.html.mustache | 4 ++-- 4 files changed, 6 insertions(+), 46 deletions(-) delete mode 100644 _gallery/01-testigalleria.json delete mode 100644 _gallery/02-otsikoton-galleria.json diff --git a/_gallery/01-testigalleria.json b/_gallery/01-testigalleria.json deleted file mode 100644 index 31bf5c0..0000000 --- a/_gallery/01-testigalleria.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "column_count": 2, - "show_title": true, - "images": [ - { - "src_thumbnail": "/media/hassu.png", - "src_hiq": "/media/hassu.png", - "title": "Hassu naama" - }, - { - "src_thumbnail": "/media/halo.png", - "src_hiq": "/media/halo.png", - "title": "Halo hajos" - } - ], - "title": "01 Testigalleria" -} \ No newline at end of file diff --git a/_gallery/02-otsikoton-galleria.json b/_gallery/02-otsikoton-galleria.json deleted file mode 100644 index a86859e..0000000 --- a/_gallery/02-otsikoton-galleria.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "show_title": false, - "column_count": 3, - "images": [ - { - "title": "placeholder 1", - "src_thumbnail": "https://via.placeholder.com/200x200", - "src_hiq": "https://via.placeholder.com/1000x1000" - }, - { - "title": "placeholder 2", - "src_hiq": "https://via.placeholder.com/1000x1000", - "src_thumbnail": "https://via.placeholder.com/200x200" - }, - { - "title": "placeholder 3", - "src_thumbnail": "/media/hassu.png", - "src_hiq": "/media/hassu.png" - } - ], - "title": "02 Otsikoton galleria" -} \ No newline at end of file diff --git a/src/admin/config.yml b/src/admin/config.yml index 2747ca7..61ade92 100644 --- a/src/admin/config.yml +++ b/src/admin/config.yml @@ -6,18 +6,17 @@ public_folder: /media collections: - name: gallery label: Gallery - identifier_name: title + identifier_name: id folder: _gallery extension: json create: true fields: + - name: id + label: Sorting key (alphabetically first is shown first on page) + widget: string - name: title label: Title widget: string - - name: show_title - label: Show title above gallery? - widget: boolean - default: false - name: column_count label: Column count widget: number diff --git a/src/index.html.mustache b/src/index.html.mustache index d01df1a..698e044 100644 --- a/src/index.html.mustache +++ b/src/index.html.mustache @@ -19,9 +19,9 @@ {{#galleries}} - {{#show_title}} + {{#title}}

{{title}}

- {{/show_title}} + {{/title}}