From e3e972a3605900a5e72a99a559569cc1497ae5f9 Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Mon, 23 Sep 2024 19:00:03 +0100 Subject: [PATCH] Add changelog banner --- src/components/Changelog/ChangelogItem.astro | 2 +- src/components/ChangelogBanner.astro | 65 ++++++++++++++++++++ src/layouts/BaseLayout.astro | 2 + 3 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 src/components/ChangelogBanner.astro diff --git a/src/components/Changelog/ChangelogItem.astro b/src/components/Changelog/ChangelogItem.astro index b7403f039..f7384e36e 100644 --- a/src/components/Changelog/ChangelogItem.astro +++ b/src/components/Changelog/ChangelogItem.astro @@ -15,7 +15,7 @@ const formattedDate = DateTime.fromISO(frontmatter.date).toFormat( ); --- -
+
diff --git a/src/components/ChangelogBanner.astro b/src/components/ChangelogBanner.astro new file mode 100644 index 000000000..e1ea7cf46 --- /dev/null +++ b/src/components/ChangelogBanner.astro @@ -0,0 +1,65 @@ +--- +import { getAllChangelogs } from '../lib/changelog'; +import { DateTime } from 'luxon'; + +const allChangelogs = await getAllChangelogs(); +const top10Changelogs = allChangelogs.slice(0, 10); +--- + +
+
+

+ Rocket + Actively Maintained +

+

+ We are always improving our content, adding new resources and adding + features to enhance your learning experience. +

+ + +
+ + +
+ +
+
diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro index b231f89bd..dadfe9be4 100644 --- a/src/layouts/BaseLayout.astro +++ b/src/layouts/BaseLayout.astro @@ -13,6 +13,7 @@ import { siteConfig } from '../lib/config'; import '../styles/global.css'; import { PageVisit } from '../components/PageVisit/PageVisit'; import type { ResourceType } from '../lib/resource-progress'; +import ChangelogBanner from "../components/ChangelogBanner.astro"; export interface Props { title: string; @@ -165,6 +166,7 @@ const gaPageIdentifier = Astro.url.pathname +