This commit refactors the CMS to handle two platforms: ContentLayer and WordPress. The CMS layer is abstracted into a core package, and separate implementations for each platform are created. This change allows the app to switch the CMS type based on environment variable, which can improve the flexibility of content management. It also updates several functions in the `server-sitemap.xml` route to accommodate these changes and generate sitemaps based on the CMS client. Further, documentation content and posts have been relocated to align with the new structure. Notably, this refactor is a comprehensive update to the way the CMS is structured and managed.
38 lines
883 B
TypeScript
38 lines
883 B
TypeScript
import { createCmsClient } from '@kit/cms';
|
|
|
|
import { SitePageHeader } from '~/(marketing)/_components/site-page-header';
|
|
import { DocsCards } from '~/(marketing)/docs/_components/docs-cards';
|
|
import appConfig from '~/config/app.config';
|
|
import { withI18n } from '~/lib/i18n/with-i18n';
|
|
|
|
export const metadata = {
|
|
title: `Documentation - ${appConfig.name}`,
|
|
};
|
|
|
|
async function DocsPage() {
|
|
const client = await createCmsClient();
|
|
|
|
const docs = await client.getContentItems({
|
|
type: 'page',
|
|
categories: ['documentation'],
|
|
depth: 1,
|
|
});
|
|
|
|
console.log(docs);
|
|
|
|
return (
|
|
<div className={'my-8 flex flex-col space-y-16'}>
|
|
<SitePageHeader
|
|
title={'Documentation'}
|
|
subtitle={'Get started with our guides and tutorials'}
|
|
/>
|
|
|
|
<div>
|
|
<DocsCards pages={docs} />
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default withI18n(DocsPage);
|