summaryrefslogtreecommitdiff
path: root/src/pages/blogs/index.astro
diff options
context:
space:
mode:
Diffstat (limited to 'src/pages/blogs/index.astro')
-rw-r--r--src/pages/blogs/index.astro50
1 files changed, 0 insertions, 50 deletions
diff --git a/src/pages/blogs/index.astro b/src/pages/blogs/index.astro
deleted file mode 100644
index e91e580..0000000
--- a/src/pages/blogs/index.astro
+++ /dev/null
@@ -1,50 +0,0 @@
----
-import Layout from "../../layouts/Layout.astro";
-import TerminalBorder from "../../components/TerminalBorder.astro";
-import BlogItem from "../../components/BlogItem.astro";
-import { getCollection } from "astro:content";
-
-function formatDate(date) {
- const day = date.getDate();
- const month = date.toLocaleString("default", { month: "long" }); // Get full month name
- const year = date.getFullYear();
-
- let suffix = "th";
- if (day === 1 || day === 21 || day === 31) {
- suffix = "st";
- } else if (day === 2 || day === 22) {
- suffix = "nd";
- } else if (day === 3 || day === 23) {
- suffix = "rd";
- }
-
- return `${month} ${day}${suffix} ${year}`;
-}
-
-const blogs = (await getCollection("blogs")).map((blog) => ({
- title: blog.data.title,
- description: blog.data.description,
- date: formatDate(blog.data.date),
- href: "/blogs/" + blog.slug,
-}));
----
-
-<Layout dir="blogs/">
- <TerminalBorder header="Shell" margin="0.5rem 0 20px">
- <p>ls ~/blogs {blogs.length}</p>
- </TerminalBorder>
- <div class="max-h-[18.5rem] overflow-y-auto">
- {
- blogs.map((blog) => (
- <>
- <BlogItem
- title={blog.title}
- description={blog.description}
- date={blog.date}
- href={blog.href}
- />
- </>
- ))
- }
- </div>
-</Layout>