Merge Paris and Lille photo highlights
This commit is contained in:
@@ -110,6 +110,17 @@ collection_groups = [
|
||||
),
|
||||
]
|
||||
|
||||
paris = "85a558a3fcf582e6f0637d6927bb5a074de422f30a389ab9589630b9c163fc0e"
|
||||
paris_lille = "e013523e4dda324d603c89f93ef3e83abbcd82cb11a16f85e53b670e8613d34f"
|
||||
uploaded_highlight_groups = [
|
||||
(
|
||||
"Paris & Lille",
|
||||
datetime(2026, 9, 19, 21, 41, 30, tzinfo=timezone.utc),
|
||||
[(paris_lille, index) for index in range(13)] +
|
||||
[(paris, index) for index in range(10)],
|
||||
),
|
||||
]
|
||||
|
||||
anchors = {armenia[0]: "Armenia", romania[0]: "Romania"}
|
||||
captions = {(OLD[2], 7): "Transmission of Flesh by Erfan Ashourioun"}
|
||||
first_for_job = {}
|
||||
@@ -159,4 +170,21 @@ for folder, group_start, anchor, filenames in collection_groups:
|
||||
json.dumps(anchor) + "\n", 1)
|
||||
path.write_text(content)
|
||||
|
||||
for anchor, group_start, photos in uploaded_highlight_groups:
|
||||
for position, (job, index) in enumerate(photos):
|
||||
path = ART / f"2026-09-19-photo-{job}-{index:02}.md"
|
||||
content = path.read_text()
|
||||
date = group_start - timedelta(seconds=position)
|
||||
content = re.sub(r"^date:.*$", f'date: "{date.isoformat()}"', content,
|
||||
count=1, flags=re.MULTILINE)
|
||||
content = re.sub(r"^anchor:.*\n", "", content, flags=re.MULTILINE)
|
||||
if position == 0:
|
||||
content = content.replace("categories: art\n", "categories: art\nanchor: " +
|
||||
json.dumps(anchor) + "\n", 1)
|
||||
elif index == 0:
|
||||
# Removing this batch's old highlight must not remove its published
|
||||
# receipt target from the rendered gallery.
|
||||
content = content.replace("---\n\n", f'---\n\n<div id="photo-{job}"></div>\n\n', 1)
|
||||
path.write_text(content)
|
||||
|
||||
print("Organized all configured photo highlights into contiguous groups")
|
||||
|
||||
Reference in New Issue
Block a user