Add article definition to suppress the '[ERROR] The build was canceled.' log.

This commit is contained in:
liding 2024-06-21 22:39:25 +08:00
parent b87816c5eb
commit 4cdce770d8
3 changed files with 39 additions and 3 deletions

5
.gitignore vendored
View File

@ -23,5 +23,6 @@ pnpm-debug.log*
# jetbrains setting folder
.idea/
# test articles
src/content/
# ignore test articles except for article definitions
src/content/*
!src/content/config.ts

View File

@ -21,4 +21,4 @@ fi
mv ${ld_site_dist_target} "${ld_site_dist_target}-old"
mv dist ${ld_site_dist_target}
rm -rf "${ld_site_dist_target}-old" ${original_article_destination}
rm -rf "${ld_site_dist_target}-old"

35
src/content/config.ts Normal file
View File

@ -0,0 +1,35 @@
import { z, defineCollection } from 'astro:content';
const blogCollection = defineCollection({
type: 'content',
schema: z.object({
title: z.string(),
description: z.string(),
category: z.string(),
lastUpdate: z.string()
}),
});
const noteCollection = defineCollection({
type: 'content',
schema: z.object({
title: z.string(),
description: z.string(),
category: z.string(),
lastUpdate: z.string()
}),
});
const translationCollection = defineCollection({
type: 'content',
schema: z.object({
title: z.string(),
description: z.string(),
category: z.string(),
lastUpdate: z.string()
}),
});
export const collections = {
'blog': blogCollection,
'note': noteCollection,
'translation': translationCollection,
};