diff --git a/src/components/changelog-next/Header.astro b/src/components/changelog-next/Header.astro index 84248467b9608f..509cbdea4f63e2 100644 --- a/src/components/changelog-next/Header.astro +++ b/src/components/changelog-next/Header.astro @@ -6,79 +6,74 @@ import { getEntry, type CollectionEntry } from "astro:content"; import { StarlightIcon } from ".."; import HeroImage from "~/assets/images/changelog-next/hero.svg"; -type Props = z.infer; +type Props = z.input; const props = z.object({ - entries: z.array(z.any()).optional(), + notes: z.any().array().default([]), }); -const { entries } = props.parse(Astro.props); +const { notes } = props.parse(Astro.props); async function uniqueProducts( - entries?: Array>, + notes: Array>, ) { - const products = entries?.flatMap((entry) => entry.data.products ?? []); - const unique = [ - ...new Map(products?.map((product) => [product.id, product])).values(), + ...new Set(notes.flatMap((e) => e.data.products.map((p) => p.id))), ]; return Promise.all( unique.map(async (product) => { - return getEntry(product); + return getEntry("products", product)!; }), ); } -const products = await uniqueProducts(entries); +const products = await uniqueProducts(notes); ---
-
-
-
- hero image -
-

Changelog

-

- New updates and improvements at Cloudflare. - - - Subscribe to RSS - - - -

- { - entries && ( -
- -
- ) - } -
- +
+

Changelog

+

+ New updates and improvements at Cloudflare. + + Subscribe to RSS + + +

+ { + products.length > 0 && ( +
+ +
+ ) + }
+ hero image
+ + diff --git a/src/components/changelog-next/ProductPills.astro b/src/components/changelog-next/ProductPills.astro index 395457a400c8c2..bafe12f5472082 100644 --- a/src/components/changelog-next/ProductPills.astro +++ b/src/components/changelog-next/ProductPills.astro @@ -20,7 +20,7 @@ const data = await getEntries(products); { data.map((product) => ( - + )) } diff --git a/src/pages/changelog-next/[...slug].astro b/src/pages/changelog-next/[...slug].astro index b675039a70f198..95cb62013ab36b 100644 --- a/src/pages/changelog-next/[...slug].astro +++ b/src/pages/changelog-next/[...slug].astro @@ -40,61 +40,37 @@ const props = {
-
-
- - - Back to all posts - + +
+

{note.data.title}

+
+ {format(note.data.date, "MMM dd, yyyy")}, { + format(note.data.date, "hh:mm a") + } +
-
-

{note.data.title}

-
- {format(note.data.date, "MMM dd, yyyy")}, { - format(note.data.date, "hh:mm a") - } - -
-
- -
+
+
diff --git a/src/pages/changelog-next/index.astro b/src/pages/changelog-next/index.astro index 5b0f896d800dcf..775421bc4652b0 100644 --- a/src/pages/changelog-next/index.astro +++ b/src/pages/changelog-next/index.astro @@ -26,53 +26,50 @@ const props = { --- -
-
- { - notes.map(async (entry) => { - const date = format(entry.data.date, "MMM dd, yyyy"); - const time = format(entry.data.date, "hh:mm a"); - const productIds = JSON.stringify( - entry.data.products.map((product) => product.id), - ); - - const { Content } = await render(entry); - - return ( - <> -
-

- {date} - {time} -

-
- -
    -
  1. -
    +
    + { + notes.map(async (entry) => { + const date = format(entry.data.date, "MMM dd, yyyy"); + const time = format(entry.data.date, "hh:mm a"); + const productIds = JSON.stringify( + entry.data.products.map((product) => product.id), + ); + + const { Content } = await render(entry); + + return ( +
    + + +
      +
    1. + -

      - -

      -
    2. -
    -
    - - ); - }) - } -
    + + +
    +

    + +

    +
  2. +
+
+
+ ); + }) + }