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"