summaryrefslogtreecommitdiff
path: root/src/content.config.ts
diff options
context:
space:
mode:
authorDawid Rycerz <dawid@rycerz.xyz>2025-07-03 13:46:07 +0300
committerDawid Rycerz <dawid@rycerz.xyz>2025-07-03 13:46:07 +0300
commitf100d259d2ffebe61fef56ea3964f6d534d598c8 (patch)
tree09d06511506da9c35585740d56598eb542fac079 /src/content.config.ts
parent1e5f5a953588cefa75396454c9aed0a79552db14 (diff)
Initial pleroma pull support
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 };