diff --git a/src/components/shortcodes/BlogRoll.astro b/src/components/shortcodes/BlogRoll.astro
new file mode 100644
index 0000000..5708b1b
--- /dev/null
+++ b/src/components/shortcodes/BlogRoll.astro
@@ -0,0 +1,19 @@
+---
+import {getCollection} from "astro:content";
+import { Image } from 'astro:assets';
+const links = await getCollection('links');
+---
+
My Blogroll
+{links.length > 0 && links.map((link =>
+
+ {link.data.avatar &&
}
+
+ {link.id}
+ - {link.data.description}
+
+))}
+
\ No newline at end of file
diff --git a/src/content/config.ts b/src/content/config.ts
index f0cc13e..c330693 100644
--- a/src/content/config.ts
+++ b/src/content/config.ts
@@ -1,17 +1,28 @@
-import { defineCollection } from 'astro:content';
-import { posts } from './posts/_schemas';
-import { pages } from "./pages/_schemas";
+import {defineCollection} from 'astro:content';
+import {posts} from './posts/_schemas';
+import {pages} from "./pages/_schemas";
+import {file} from 'astro/loaders';
+import { z } from 'astro:content';
const blogCollection = defineCollection({
- type: 'content',
- schema: posts,
+ type: 'content',
+ schema: posts,
});
const pageCollection = defineCollection({
type: 'content',
schema: pages,
});
+const blogRollData = defineCollection({
+ loader: file("src/data/links.yaml"),
+ schema: z.object({
+ link: z.string(),
+ avatar: z.string().optional(),
+ description: z.string().optional(),
+ })
+});
export const collections = {
- 'posts': blogCollection,
- 'pages': pageCollection,
+ 'posts': blogCollection,
+ 'pages': pageCollection,
+ 'links': blogRollData,
};
\ No newline at end of file
diff --git a/src/content/pages/test.md b/src/content/pages/test.md
deleted file mode 100644
index 7818aee..0000000
--- a/src/content/pages/test.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-title: 'Test Page'
-description: 'This is a test page'
----
-testestestest
\ No newline at end of file
diff --git a/src/content/pages/test.mdx b/src/content/pages/test.mdx
new file mode 100644
index 0000000..2f6b370
--- /dev/null
+++ b/src/content/pages/test.mdx
@@ -0,0 +1,9 @@
+---
+title: 'Test Page'
+description: 'This is a test page'
+---
+import BlogRoll from "../../components/shortcodes/BlogRoll.astro"
+
+testestestest
+
+
\ No newline at end of file
diff --git a/src/content/posts/_schemas.ts b/src/content/posts/_schemas.ts
index 25b39dd..e62adfb 100644
--- a/src/content/posts/_schemas.ts
+++ b/src/content/posts/_schemas.ts
@@ -1,6 +1,6 @@
import { z } from 'astro:content';
-export const posts = ({ image }:{image: ()=> z.ZodAny}) => z.object({
+export const posts = ({ image }) => z.object({
title: z.string(),
description: z.string(),
pubDate: z.coerce.date(),
diff --git a/src/data/links.yaml b/src/data/links.yaml
new file mode 100644
index 0000000..ae22321
--- /dev/null
+++ b/src/data/links.yaml
@@ -0,0 +1,7 @@
+Link: # the name/title of the destination
+ link: https://www.youtube.com/watch?v=cqT0OKlEo9w # the link to the destination
+ avatar: https://example.org/avatar.png # set an avatar
+ description: We know each other for so long # the description
+Another Link:
+ link: https://google.com
+ description: Your heart's been aching, but you're too shy to say it
\ No newline at end of file