summaryrefslogtreecommitdiff
path: root/src/pages/blogs
diff options
context:
space:
mode:
Diffstat (limited to 'src/pages/blogs')
-rw-r--r--src/pages/blogs/[...slug].astro3
-rw-r--r--src/pages/blogs/index.astro50
2 files changed, 3 insertions, 50 deletions
diff --git a/src/pages/blogs/[...slug].astro b/src/pages/blogs/[...slug].astro
index 37e6f53..3e42575 100644
--- a/src/pages/blogs/[...slug].astro
+++ b/src/pages/blogs/[...slug].astro
@@ -1,5 +1,6 @@
---
import Blog from "../../layouts/Blog.astro";
+import RadarChart from "../../components/RadarChart.astro"
import { getCollection } from "astro:content";
export async function getStaticPaths() {
@@ -15,5 +16,7 @@ const { Content } = await entry.render();
---
<Blog title=`/home/kyren/blogs/${entry.slug}`>
+ <h1>Test</h1>
+ <RadarChart></RadarChart>
<Content />
</Blog>
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>