Refactor content fetching and enhance UI mods
Refactored content fetching in the docs and blog pages to use a new 'getDocs' function to improve code reuse. Made minor adjustments to the UI in 'makerkit/page.tsx'. This involved modifying the layout and adding conditionals to tackle optional props. Also added a new textarea component reference in the UI package.
This commit is contained in:
14
apps/web/app/(marketing)/docs/_lib/server/docs.loader.ts
Normal file
14
apps/web/app/(marketing)/docs/_lib/server/docs.loader.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { cache } from 'react';
|
||||
|
||||
import { createCmsClient } from '@kit/cms';
|
||||
|
||||
export const getDocs = cache(async (language: string | undefined) => {
|
||||
const cms = await createCmsClient();
|
||||
|
||||
const { items: pages } = await cms.getContentItems({
|
||||
collection: 'documentation',
|
||||
language,
|
||||
});
|
||||
|
||||
return pages;
|
||||
});
|
||||
Reference in New Issue
Block a user