Preserve gallery order at Jekyll date precision

This commit is contained in:
2026-09-19 18:17:09 +03:30
parent b6b19c07bb
commit f6cb9573a7
19 changed files with 21 additions and 19 deletions
@@ -1,7 +1,7 @@
--- ---
layout: post layout: post
title: "photo-260cc99527c13f256d4ea39d0959f5daa942c888ea882852e73fd94f6c30b7db" title: "photo-260cc99527c13f256d4ea39d0959f5daa942c888ea882852e73fd94f6c30b7db"
date: "2026-09-19T12:29:32.999986+00:00" date: "2026-09-19T12:29:19+00:00"
categories: art categories: art
--- ---
@@ -1,7 +1,7 @@
--- ---
layout: post layout: post
title: "photo-474ab3283ce8801ac6e59b67b65b4169167053873a5a8db4a15b840a3448266c" title: "photo-474ab3283ce8801ac6e59b67b65b4169167053873a5a8db4a15b840a3448266c"
date: "2026-09-19T12:29:32.999994+00:00" date: "2026-09-19T12:29:27+00:00"
categories: art categories: art
--- ---
@@ -1,7 +1,7 @@
--- ---
layout: post layout: post
title: "photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-00" title: "photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-00"
date: "2026-09-19T12:29:32.999993+00:00" date: "2026-09-19T12:29:26+00:00"
categories: art categories: art
anchor: "Romania" anchor: "Romania"
--- ---
@@ -1,7 +1,7 @@
--- ---
layout: post layout: post
title: "photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-01" title: "photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-01"
date: "2026-09-19T12:29:32.999992+00:00" date: "2026-09-19T12:29:25+00:00"
categories: art categories: art
--- ---
@@ -1,7 +1,7 @@
--- ---
layout: post layout: post
title: "photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-02" title: "photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-02"
date: "2026-09-19T12:29:32.999984+00:00" date: "2026-09-19T12:29:17+00:00"
categories: art categories: art
--- ---
@@ -1,7 +1,7 @@
--- ---
layout: post layout: post
title: "photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-03" title: "photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-03"
date: "2026-09-19T12:29:32.999983+00:00" date: "2026-09-19T12:29:16+00:00"
categories: art categories: art
--- ---
@@ -1,7 +1,7 @@
--- ---
layout: post layout: post
title: "photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-04" title: "photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-04"
date: "2026-09-19T12:29:32.999995+00:00" date: "2026-09-19T12:29:28+00:00"
categories: art categories: art
--- ---
@@ -1,7 +1,7 @@
--- ---
layout: post layout: post
title: "photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-05" title: "photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-05"
date: "2026-09-19T12:29:32.999996+00:00" date: "2026-09-19T12:29:29+00:00"
categories: art categories: art
--- ---
@@ -1,7 +1,7 @@
--- ---
layout: post layout: post
title: "photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-06" title: "photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-06"
date: "2026-09-19T12:29:32.999997+00:00" date: "2026-09-19T12:29:30+00:00"
categories: art categories: art
--- ---
@@ -1,7 +1,7 @@
--- ---
layout: post layout: post
title: "photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-07" title: "photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-07"
date: "2026-09-19T12:29:32.999998+00:00" date: "2026-09-19T12:29:31+00:00"
categories: art categories: art
--- ---
@@ -1,7 +1,7 @@
--- ---
layout: post layout: post
title: "photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-08" title: "photo-7c832afa1b73023d8f2391ff40c221be9ffd468a1a96a6bf4900cbf95595d31d-08"
date: "2026-09-19T12:29:32.999999+00:00" date: "2026-09-19T12:29:32+00:00"
categories: art categories: art
--- ---
@@ -1,7 +1,7 @@
--- ---
layout: post layout: post
title: "photo-b18a2f1c7127077c801160782012cb164759f0b9dd41762205b45e4c9a07d673" title: "photo-b18a2f1c7127077c801160782012cb164759f0b9dd41762205b45e4c9a07d673"
date: "2026-09-19T12:29:32.999985+00:00" date: "2026-09-19T12:29:18+00:00"
categories: art categories: art
--- ---
@@ -1,7 +1,7 @@
--- ---
layout: post layout: post
title: "photo-c53f20236f166632bff163339c8e789cc09b0d7e63c5b531b1fc20705460975b" title: "photo-c53f20236f166632bff163339c8e789cc09b0d7e63c5b531b1fc20705460975b"
date: "2026-09-19T12:29:32.999991+00:00" date: "2026-09-19T12:29:24+00:00"
categories: art categories: art
--- ---
@@ -1,7 +1,7 @@
--- ---
layout: post layout: post
title: "photo-c53f20236f166632bff163339c8e789cc09b0d7e63c5b531b1fc20705460975b-01" title: "photo-c53f20236f166632bff163339c8e789cc09b0d7e63c5b531b1fc20705460975b-01"
date: "2026-09-19T12:29:32.999990+00:00" date: "2026-09-19T12:29:23+00:00"
categories: art categories: art
--- ---
@@ -1,7 +1,7 @@
--- ---
layout: post layout: post
title: "photo-c53f20236f166632bff163339c8e789cc09b0d7e63c5b531b1fc20705460975b-02" title: "photo-c53f20236f166632bff163339c8e789cc09b0d7e63c5b531b1fc20705460975b-02"
date: "2026-09-19T12:29:32.999989+00:00" date: "2026-09-19T12:29:22+00:00"
categories: art categories: art
--- ---
@@ -1,7 +1,7 @@
--- ---
layout: post layout: post
title: "photo-c53f20236f166632bff163339c8e789cc09b0d7e63c5b531b1fc20705460975b-03" title: "photo-c53f20236f166632bff163339c8e789cc09b0d7e63c5b531b1fc20705460975b-03"
date: "2026-09-19T12:29:32.999988+00:00" date: "2026-09-19T12:29:21+00:00"
categories: art categories: art
--- ---
@@ -1,7 +1,7 @@
--- ---
layout: post layout: post
title: "photo-c53f20236f166632bff163339c8e789cc09b0d7e63c5b531b1fc20705460975b-04" title: "photo-c53f20236f166632bff163339c8e789cc09b0d7e63c5b531b1fc20705460975b-04"
date: "2026-09-19T12:29:32.999987+00:00" date: "2026-09-19T12:29:20+00:00"
categories: art categories: art
--- ---
+3 -1
View File
@@ -82,7 +82,9 @@ def web_image(raw, destination):
def photo_entry(job, date, index, count, caption, highlight): def photo_entry(job, date, index, count, caption, highlight):
# Give each photo its own collection document. Descending dates preserve the # Give each photo its own collection document. Descending dates preserve the
# selection order because the gallery renders the newest document first. # selection order because the gallery renders the newest document first.
item_date = datetime.fromisoformat(date) + timedelta(microseconds=count - index) # Jekyll's collection ordering only preserves whole seconds. Give each item
# a distinct second so filenames cannot disturb the selected photo order.
item_date = datetime.fromisoformat(date) + timedelta(seconds=count - index)
title = f"photo-{job}" if index == 0 else f"photo-{job}-{index:02}" title = f"photo-{job}" if index == 0 else f"photo-{job}-{index:02}"
content = ["---", "layout: post", f'title: "{title}"', content = ["---", "layout: post", f'title: "{title}"',
f'date: "{item_date.isoformat()}"', "categories: art"] f'date: "{item_date.isoformat()}"', "categories: art"]
+1 -1
View File
@@ -42,7 +42,7 @@ for position, (job, index) in enumerate(ordered):
title = f"photo-{job}-{index:02}" title = f"photo-{job}-{index:02}"
if (job, index) == first_for_job[job]: if (job, index) == first_for_job[job]:
title = f"photo-{job}" title = f"photo-{job}"
date = start - timedelta(microseconds=position) date = start - timedelta(seconds=position)
lines = ["---", "layout: post", f'title: "{title}"', lines = ["---", "layout: post", f'title: "{title}"',
f'date: "{date.isoformat()}"', "categories: art"] f'date: "{date.isoformat()}"', "categories: art"]
if (job, index) in anchors: if (job, index) in anchors: