diff options
| author | Dawid Rycerz <dawid@rycerz.xyz> | 2025-07-03 13:46:07 +0300 |
|---|---|---|
| committer | Dawid Rycerz <dawid@rycerz.xyz> | 2025-07-03 13:46:07 +0300 |
| commit | f100d259d2ffebe61fef56ea3964f6d534d598c8 (patch) | |
| tree | 09d06511506da9c35585740d56598eb542fac079 /src/content.config.ts | |
| parent | 1e5f5a953588cefa75396454c9aed0a79552db14 (diff) | |
Initial pleroma pull support
Diffstat (limited to 'src/content.config.ts')
| -rw-r--r-- | src/content.config.ts | 16 |
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 }; |
