feat: garden celebration update - evergreen log

This commit is contained in:
svemagie
2026-03-23 17:41:59 +01:00
parent d969fa5e3e
commit 8b68846b5b
2 changed files with 31 additions and 7 deletions
+7 -7
View File
File diff suppressed because one or more lines are too long
+24
View File
@@ -161,6 +161,13 @@ export class Publisher {
(fm["gardenStage"] as string | undefined) ?? gardenStageFromTags;
if (gardenStage) {
props["gardenStage"] = [gardenStage];
// Pass through the evergreen date so Indiekit writes it to the blog post.
if (gardenStage === "evergreen") {
const evergreeSince = fm["evergreen-since"] as string | undefined;
if (evergreeSince) {
props["evergreeSince"] = [String(evergreeSince)];
}
}
}
}
@@ -377,6 +384,23 @@ export class Publisher {
}
}
// Stamp evergreen-since on first promotion to the evergreen garden stage.
{
const { frontmatter: fm } = this.parseFrontmatter(originalContent);
if (!fm["evergreen-since"]) {
const rawTags = [
...this.resolveArray(fm["tags"]),
...this.resolveArray(fm["category"]),
];
const stage =
(fm["gardenStage"] as string | undefined) ??
this.extractGardenStage(rawTags);
if (stage === "evergreen") {
fields.push(["evergreen-since", publishedDate]);
}
}
}
const fmMatch = originalContent.match(
/^(---\r?\n[\s\S]*?\r?\n---\r?\n)([\s\S]*)$/,
);