diff --git a/css/tailwind.css b/css/tailwind.css index 83ed59e..1bbafb7 100644 --- a/css/tailwind.css +++ b/css/tailwind.css @@ -1135,4 +1135,23 @@ body[data-indiekit-auth="true"] .share-post-btn:hover { hover:bg-surface-50 dark:hover:bg-surface-800/50 transition-colors; } + + /* Celebration card for posts that recently reached evergreen status */ + .garden-evergreen-celebration { + @apply p-4 rounded-lg border transition-colors; + border-color: rgb(66 123 88 / 0.4); + background-color: rgb(66 123 88 / 0.06); + } + .garden-evergreen-celebration:hover { + border-color: rgb(66 123 88 / 0.6); + background-color: rgb(66 123 88 / 0.1); + } + .dark .garden-evergreen-celebration { + border-color: rgb(142 192 124 / 0.3); + background-color: rgb(142 192 124 / 0.06); + } + .dark .garden-evergreen-celebration:hover { + border-color: rgb(142 192 124 / 0.45); + background-color: rgb(142 192 124 / 0.1); + } } diff --git a/eleventy.config.js b/eleventy.config.js index 9ba9cd7..f352814 100644 --- a/eleventy.config.js +++ b/eleventy.config.js @@ -1288,6 +1288,26 @@ export default function (eleventyConfig) { .sort((a, b) => b.date - a.date); }); + // Posts that recently reached evergreen status (within the last 90 days). + // Requires evergreeSince frontmatter field, written by the Micropub plugin on first evergreen publish. + eleventyConfig.addCollection("recentEvergreens", function (collectionApi) { + const cutoff = new Date(); + cutoff.setDate(cutoff.getDate() - 90); + return collectionApi + .getFilteredByGlob("content/**/*.md") + .filter(isPublished) + .filter((item) => { + if (item.data.gardenStage !== "evergreen") return false; + if (!item.data.evergreeSince) return false; + const d = new Date(item.data.evergreeSince); + return !isNaN(d.getTime()) && d >= cutoff; + }) + .sort( + (a, b) => + new Date(b.data.evergreeSince) - new Date(a.data.evergreeSince), + ); + }); + // Weekly digests — posts grouped by ISO week for digest pages and RSS feed eleventyConfig.addCollection("weeklyDigests", function (collectionApi) { const allPosts = collectionApi diff --git a/garden.njk b/garden.njk index 9ad08c1..6ff9a70 100644 --- a/garden.njk +++ b/garden.njk @@ -32,6 +32,50 @@ pagefindIgnore: true + {# ── Recently Evergreened ─────────────────────────────────────────────── #} + {% if collections.recentEvergreens and collections.recentEvergreens.length > 0 %} +
+
+

+ 🌳 + Recently Evergreened +

+ + reached maturity in the last 90 days + +
+

+ These notes have grown into stable, reference-worthy pieces. +

+ +
+ {% endif %} + {# ── Posts grouped by stage ──────────────────────────────────────────── #} {% set _stages = ["plant", "cultivate", "evergreen", "question", "repot", "revitalize", "revisit"] %}