mirror of
https://github.com/withastro/astro.git
synced 2025-01-06 22:10:10 -05:00
51 lines
663 B
TypeScript
51 lines
663 B
TypeScript
import { defineConfig } from 'astro/config';
|
|
import db, { defineCollection, field } from '@astrojs/db';
|
|
|
|
const Author = defineCollection({
|
|
fields: {
|
|
name: field.text(),
|
|
},
|
|
source: 'readable',
|
|
data() {
|
|
return [
|
|
{
|
|
name: 'Ben',
|
|
},
|
|
{
|
|
name: 'Nate',
|
|
},
|
|
{
|
|
name: 'Erika',
|
|
},
|
|
{
|
|
name: 'Bjorn',
|
|
},
|
|
{
|
|
name: 'Sarah',
|
|
},
|
|
]
|
|
}
|
|
});
|
|
|
|
const Themes = defineCollection({
|
|
fields: {
|
|
name: field.text(),
|
|
},
|
|
source: 'writable',
|
|
data() {
|
|
return [
|
|
{
|
|
name: 'One',
|
|
},
|
|
]
|
|
}
|
|
});
|
|
|
|
// https://astro.build/config
|
|
export default defineConfig({
|
|
integrations: [db()],
|
|
db: {
|
|
collections: { Author, Themes },
|
|
}
|
|
});
|
|
|