diff options
author | Valentin Popov <valentin@popov.link> | 2025-06-10 17:05:48 +0300 |
---|---|---|
committer | Valentin Popov <valentin@popov.link> | 2025-06-10 17:05:48 +0300 |
commit | 4e8c17a6eadebf847e497752a6f0bda25cd29f49 (patch) | |
tree | c6d5472e3c2ed88eae79fbe2a5453d25d4a773c5 /src/pages/blog | |
parent | 6a47cb4165e317721d0ebb7ff8bc33c53fa265dd (diff) | |
download | popov.link-4e8c17a6eadebf847e497752a6f0bda25cd29f49.tar.xz popov.link-4e8c17a6eadebf847e497752a6f0bda25cd29f49.zip |
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.
Diffstat (limited to 'src/pages/blog')
-rw-r--r-- | src/pages/blog/index.astro | 17 |
1 files changed, 17 insertions, 0 deletions
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()); +--- + +<Layout> + <section style={{ "margin-top": "3rem" }}> + {posts.map((post) => <PostSummary post={post} />)} + </section> +</Layout> |