Replaced contentlayer with keystatic

This commit is contained in:
giancarlo
2024-04-10 14:52:18 +08:00
parent f729bf6077
commit 006c4d430f
37 changed files with 2842 additions and 2776 deletions

View File

@@ -16,25 +16,25 @@ export async function createCmsClient(
async function cmsClientFactory(type: CmsType) {
switch (type) {
case 'contentlayer':
return getContentLayerClient();
case 'wordpress':
return getWordpressClient();
case 'keystatic':
return getKeystaticClient();
default:
throw new Error(`Unknown CMS type`);
}
}
async function getContentLayerClient() {
const { ContentlayerClient } = await import('../../contentlayer/src/client');
return new ContentlayerClient();
}
async function getWordpressClient() {
const { WordpressClient } = await import('../../wordpress/src/wp-client');
return new WordpressClient();
}
async function getKeystaticClient() {
const { KeystaticClient } = await import('../../keystatic/src/client');
return new KeystaticClient();
}