From bb7481670eedd4693f8e698261dc87243fd29448 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Tue, 10 Jun 2025 13:44:56 +0000 Subject: feat: add header component and update blog layout - Introduced a new Header component for site navigation. - Integrated Header into BaseLayout for consistent site structure. - Updated blog post layout to include the post title in a dedicated section. - Minor update to README for license clarity. --- src/components/Header.astro | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/components/Header.astro (limited to 'src/components/Header.astro') diff --git a/src/components/Header.astro b/src/components/Header.astro new file mode 100644 index 0000000..b371be6 --- /dev/null +++ b/src/components/Header.astro @@ -0,0 +1,22 @@ + + +
+ Home + Blog +
-- cgit v1.2.3 From 4e8c17a6eadebf847e497752a6f0bda25cd29f49 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Tue, 10 Jun 2025 14:05:48 +0000 Subject: chore: update blog routing and header link - Removed the redirects for the blog route in the configuration. - Updated the blog link in the Header component to include a trailing slash. - Added a new index page for the blog to display all posts. --- astro.config.mjs | 6 ------ src/components/Header.astro | 2 +- src/pages/blog/index.astro | 17 +++++++++++++++++ 3 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 src/pages/blog/index.astro (limited to 'src/components/Header.astro') diff --git a/astro.config.mjs b/astro.config.mjs index d8e7708..07e5d30 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -15,10 +15,4 @@ export default defineConfig({ theme: "vitesse-dark", }, }, - redirects: { - "/blog": { - destination: "/", - status: 301, - }, - }, }); diff --git a/src/components/Header.astro b/src/components/Header.astro index b371be6..4571a5c 100644 --- a/src/components/Header.astro +++ b/src/components/Header.astro @@ -18,5 +18,5 @@
Home - Blog + Blog
diff --git a/src/pages/blog/index.astro b/src/pages/blog/index.astro new file mode 100644 index 0000000..210a7a1 --- /dev/null +++ b/src/pages/blog/index.astro @@ -0,0 +1,17 @@ +--- +import { getCollection } from "astro:content"; +import Layout from "../../layouts/BaseLayout.astro"; +import PostSummary from "../../components/PostSummary.astro"; + +const posts = await getCollection("blog", ({ data }) => { + return data.draft !== true; +}); + +posts.sort((a, b) => b.data.pubDate.getTime() - a.data.pubDate.getTime()); +--- + + +
+ {posts.map((post) => )} +
+
-- cgit v1.2.3