fix: rename evergreenSince to evergreen-since for consistent kebab-case

Sends evergreen-since as Micropub property so Indiekit writes it with
the correct frontmatter key. Also fixes first-publish bug: falls back
to today's date so the recentEvergreens collection filter never silently
drops a newly promoted post.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
svemagie
2026-04-27 16:09:02 +02:00
parent 4e44912016
commit 73a072e298
2 changed files with 13 additions and 9 deletions
+5 -5
View File
File diff suppressed because one or more lines are too long
+8 -4
View File
@@ -186,11 +186,15 @@ export class Publisher {
if (gardenStage) {
props["gardenStage"] = [gardenStage];
// Pass through the evergreen date so Indiekit writes it to the blog post.
// On first promotion evergreen-since is not in the note yet (writeUrlToNote
// stamps it after publish), so we fall back to today to ensure Indiekit
// writes evergreen-since immediately — without it the recentEvergreens
// collection filter silently drops the post.
if (gardenStage === "evergreen") {
const evergreenSince = fm["evergreen-since"] as string | undefined;
if (evergreenSince) {
props["evergreenSince"] = [String(evergreenSince)];
}
const evergreenSince =
(fm["evergreen-since"] as string | undefined) ??
new Date().toISOString().slice(0, 10);
props["evergreen-since"] = [evergreenSince];
}
}
}