From 1e9fbb0681a5b60aea6eb578bce48f129cf99056 Mon Sep 17 00:00:00 2001 From: Jeremy Frank <37932802+0xjeremyfrank@users.noreply.github.com> Date: Thu, 6 Aug 2026 13:07:28 -0600 Subject: [PATCH] Sort CRE templates by publication date --- src/pages/cre-templates/index.astro | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/cre-templates/index.astro b/src/pages/cre-templates/index.astro index 3f3f47dbf29..085f5f70795 100644 --- a/src/pages/cre-templates/index.astro +++ b/src/pages/cre-templates/index.astro @@ -3,7 +3,9 @@ import { getCollection } from "astro:content" import BaseLayout from "~/layouts/BaseLayout.astro" import TemplateCard from "~/components/CRETemplate/TemplateCard.astro" -const templates = await getCollection("cre-templates") +const templates = (await getCollection("cre-templates")).sort( + (a, b) => (b.data.datePublished ?? "").localeCompare(a.data.datePublished ?? "") +) const featuredTemplate = templates.find((t) => t.data.featured) const pageTitle = "CRE Templates Hub | Chainlink Documentation"