feat: multi-authors support
This commit is contained in:
parent
af55568839
commit
458dc2dafe
9 changed files with 54 additions and 8 deletions
|
@ -3,6 +3,7 @@ import {posts} from './posts/_schemas';
|
|||
import {pages} from "./pages/_schemas";
|
||||
import {file} from 'astro/loaders';
|
||||
import { z } from 'astro:content';
|
||||
import {siteConfig} from "../config.ts";
|
||||
|
||||
const blogCollection = defineCollection({
|
||||
type: 'content',
|
||||
|
@ -21,8 +22,21 @@ const blogRollData = defineCollection({
|
|||
})
|
||||
});
|
||||
|
||||
const authorsData = defineCollection({
|
||||
loader: file("src/data/authors.yaml"),
|
||||
schema: z.object({
|
||||
name: z.string().default(siteConfig.defaultAuthor.name),
|
||||
email: z.string().email().default(siteConfig.defaultAuthor.email),
|
||||
social: z.object({
|
||||
twitter: z.string().optional(),
|
||||
fediverse: z.string().optional(),
|
||||
}).optional(),
|
||||
})
|
||||
});
|
||||
|
||||
export const collections = {
|
||||
'posts': blogCollection,
|
||||
'pages': pageCollection,
|
||||
'links': blogRollData,
|
||||
'authors': authorsData,
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue