Enhancements were implemented to support hierarchical documentation. Local CMS now respects parent ID and order attributes of content items, and content can be categories as 'blog' or 'documentation'. Changes were also made to the wordpress integration supporting these new categorizations. Introduced working with nested documentation pages.
45 lines
1.2 KiB
TypeScript
45 lines
1.2 KiB
TypeScript
import { createCmsClient } from '@kit/cms';
|
|
|
|
import { GridList } from '~/(marketing)/_components/grid-list';
|
|
import { SitePageHeader } from '~/(marketing)/_components/site-page-header';
|
|
import { PostPreview } from '~/(marketing)/blog/_components/post-preview';
|
|
import { createI18nServerInstance } from '~/lib/i18n/i18n.server';
|
|
import { withI18n } from '~/lib/i18n/with-i18n';
|
|
|
|
export const generateMetadata = async () => {
|
|
const { t } = await createI18nServerInstance();
|
|
|
|
return {
|
|
title: t('marketing:blog'),
|
|
description: t('marketing:blogSubtitle'),
|
|
};
|
|
};
|
|
|
|
async function BlogPage() {
|
|
const { t } = await createI18nServerInstance();
|
|
const cms = await createCmsClient();
|
|
|
|
const posts = await cms.getContentItems({
|
|
categories: ['blog'],
|
|
});
|
|
|
|
return (
|
|
<div className={'container mx-auto'}>
|
|
<div className={'my-8 flex flex-col space-y-16'}>
|
|
<SitePageHeader
|
|
title={t('marketing:blog')}
|
|
subtitle={t('marketing:blogSubtitle')}
|
|
/>
|
|
|
|
<GridList>
|
|
{posts.map((post, idx) => {
|
|
return <PostPreview key={idx} post={post} />;
|
|
})}
|
|
</GridList>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default withI18n(BlogPage);
|