feat: support disable docs module
This commit is contained in:
parent
866988d73c
commit
a1ae6ca384
@ -14,7 +14,6 @@ type Href = Parameters<typeof getLocalePathname>[0]['href'];
|
|||||||
const staticRoutes = [
|
const staticRoutes = [
|
||||||
'/',
|
'/',
|
||||||
'/pricing',
|
'/pricing',
|
||||||
'/docs',
|
|
||||||
'/about',
|
'/about',
|
||||||
'/contact',
|
'/contact',
|
||||||
'/waitlist',
|
'/waitlist',
|
||||||
@ -24,6 +23,8 @@ const staticRoutes = [
|
|||||||
'/cookie',
|
'/cookie',
|
||||||
'/auth/login',
|
'/auth/login',
|
||||||
'/auth/register',
|
'/auth/register',
|
||||||
|
...(websiteConfig.blog.enable ? ['/blog'] : []),
|
||||||
|
...(websiteConfig.docs.enable ? ['/docs'] : []),
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -133,7 +134,8 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// add docs
|
// add docs related routes if enabled
|
||||||
|
if (websiteConfig.docs.enable) {
|
||||||
const docsParams = source.generateParams();
|
const docsParams = source.generateParams();
|
||||||
sitemapList.push(
|
sitemapList.push(
|
||||||
...docsParams.flatMap((param) =>
|
...docsParams.flatMap((param) =>
|
||||||
@ -145,6 +147,7 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
|||||||
}))
|
}))
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return sitemapList;
|
return sitemapList;
|
||||||
}
|
}
|
||||||
|
@ -51,11 +51,15 @@ export function getFooterLinks(): NestedMenuItem[] {
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
: []),
|
: []),
|
||||||
|
...(websiteConfig.docs.enable
|
||||||
|
? [
|
||||||
{
|
{
|
||||||
title: t('resources.items.docs'),
|
title: t('resources.items.docs'),
|
||||||
href: Routes.Docs,
|
href: Routes.Docs,
|
||||||
external: false,
|
external: false,
|
||||||
},
|
},
|
||||||
|
]
|
||||||
|
: []),
|
||||||
{
|
{
|
||||||
title: t('resources.items.changelog'),
|
title: t('resources.items.changelog'),
|
||||||
href: Routes.Changelog,
|
href: Routes.Changelog,
|
||||||
|
@ -69,11 +69,15 @@ export function getNavbarLinks(): NestedMenuItem[] {
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
: []),
|
: []),
|
||||||
|
...(websiteConfig.docs.enable
|
||||||
|
? [
|
||||||
{
|
{
|
||||||
title: t('docs.title'),
|
title: t('docs.title'),
|
||||||
href: Routes.Docs,
|
href: Routes.Docs,
|
||||||
external: false,
|
external: false,
|
||||||
},
|
},
|
||||||
|
]
|
||||||
|
: []),
|
||||||
{
|
{
|
||||||
title: t('ai.title'),
|
title: t('ai.title'),
|
||||||
items: [
|
items: [
|
||||||
|
@ -68,10 +68,13 @@ export const websiteConfig: WebsiteConfig = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
blog: {
|
blog: {
|
||||||
enable: false,
|
enable: true,
|
||||||
paginationSize: 6,
|
paginationSize: 6,
|
||||||
relatedPostsSize: 3,
|
relatedPostsSize: 3,
|
||||||
},
|
},
|
||||||
|
docs: {
|
||||||
|
enable: true,
|
||||||
|
},
|
||||||
mail: {
|
mail: {
|
||||||
provider: 'resend',
|
provider: 'resend',
|
||||||
fromEmail: 'MkSaaS <support@mksaas.com>',
|
fromEmail: 'MkSaaS <support@mksaas.com>',
|
||||||
|
8
src/types/index.d.ts
vendored
8
src/types/index.d.ts
vendored
@ -13,6 +13,7 @@ export type WebsiteConfig = {
|
|||||||
auth: AuthConfig;
|
auth: AuthConfig;
|
||||||
i18n: I18nConfig;
|
i18n: I18nConfig;
|
||||||
blog: BlogConfig;
|
blog: BlogConfig;
|
||||||
|
docs: DocsConfig;
|
||||||
mail: MailConfig;
|
mail: MailConfig;
|
||||||
newsletter: NewsletterConfig;
|
newsletter: NewsletterConfig;
|
||||||
storage: StorageConfig;
|
storage: StorageConfig;
|
||||||
@ -116,6 +117,13 @@ export interface BlogConfig {
|
|||||||
relatedPostsSize: number; // Number of related posts to show
|
relatedPostsSize: number; // Number of related posts to show
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Docs configuration
|
||||||
|
*/
|
||||||
|
export interface DocsConfig {
|
||||||
|
enable: boolean; // Whether to enable the docs
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mail configuration
|
* Mail configuration
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user