summaryrefslogtreecommitdiff
path: root/src/content.config.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/content.config.ts')
-rw-r--r--src/content.config.ts16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/content.config.ts b/src/content.config.ts
index 271b472..5930884 100644
--- a/src/content.config.ts
+++ b/src/content.config.ts
@@ -1,5 +1,6 @@
import { defineCollection, z } from "astro:content";
import { glob } from "astro/loaders";
+import { pleromaLoader } from "./loaders/pleroma";
function removeDupsAndLowerCase(array: string[]) {
return [...new Set(array.map((str) => str.toLowerCase()))];
@@ -47,6 +48,19 @@ const note = defineCollection({
}),
});
+const micro = defineCollection({
+ loader: pleromaLoader({
+ instanceUrl: "https://social.craftknight.com",
+ username: "dawid",
+ maxPosts: 50,
+ feedType: "atom",
+ }),
+ schema: baseSchema.extend({
+ description: z.string().optional(),
+ publishDate: z.date().or(z.string().transform((val) => new Date(val))),
+ }),
+});
+
const tag = defineCollection({
loader: glob({ base: "./src/content/tag", pattern: "**/*.{md,mdx}" }),
schema: z.object({
@@ -55,4 +69,4 @@ const tag = defineCollection({
}),
});
-export const collections = { post, note, tag };
+export const collections = { post, note, tag, micro };