diff --git a/src/app/sitemap.ts b/src/app/sitemap.ts index f3a53df..4b17e75 100644 --- a/src/app/sitemap.ts +++ b/src/app/sitemap.ts @@ -14,7 +14,6 @@ type Href = Parameters[0]['href']; const staticRoutes = [ '/', '/pricing', - '/docs', '/about', '/contact', '/waitlist', @@ -24,6 +23,8 @@ const staticRoutes = [ '/cookie', '/auth/login', '/auth/register', + ...(websiteConfig.blog.enable ? ['/blog'] : []), + ...(websiteConfig.docs.enable ? ['/docs'] : []), ]; /** @@ -133,18 +134,20 @@ export default async function sitemap(): Promise { ); } - // add docs - const docsParams = source.generateParams(); - sitemapList.push( - ...docsParams.flatMap((param) => - routing.locales.map((locale) => ({ - url: getUrl(`/docs/${param.slug.join('/')}`, locale), - lastModified: new Date(), - priority: 0.8, - changeFrequency: 'weekly' as const, - })) - ) - ); + // add docs related routes if enabled + if (websiteConfig.docs.enable) { + const docsParams = source.generateParams(); + sitemapList.push( + ...docsParams.flatMap((param) => + routing.locales.map((locale) => ({ + url: getUrl(`/docs/${param.slug.join('/')}`, locale), + lastModified: new Date(), + priority: 0.8, + changeFrequency: 'weekly' as const, + })) + ) + ); + } return sitemapList; } diff --git a/src/config/footer-config.tsx b/src/config/footer-config.tsx index 4aadece..a3207a7 100644 --- a/src/config/footer-config.tsx +++ b/src/config/footer-config.tsx @@ -51,11 +51,15 @@ export function getFooterLinks(): NestedMenuItem[] { }, ] : []), - { - title: t('resources.items.docs'), - href: Routes.Docs, - external: false, - }, + ...(websiteConfig.docs.enable + ? [ + { + title: t('resources.items.docs'), + href: Routes.Docs, + external: false, + }, + ] + : []), { title: t('resources.items.changelog'), href: Routes.Changelog, diff --git a/src/config/navbar-config.tsx b/src/config/navbar-config.tsx index f37c190..ce14155 100644 --- a/src/config/navbar-config.tsx +++ b/src/config/navbar-config.tsx @@ -69,11 +69,15 @@ export function getNavbarLinks(): NestedMenuItem[] { }, ] : []), - { - title: t('docs.title'), - href: Routes.Docs, - external: false, - }, + ...(websiteConfig.docs.enable + ? [ + { + title: t('docs.title'), + href: Routes.Docs, + external: false, + }, + ] + : []), { title: t('ai.title'), items: [ diff --git a/src/config/website.tsx b/src/config/website.tsx index 6e4e9c0..c308d8f 100644 --- a/src/config/website.tsx +++ b/src/config/website.tsx @@ -68,10 +68,13 @@ export const websiteConfig: WebsiteConfig = { }, }, blog: { - enable: false, + enable: true, paginationSize: 6, relatedPostsSize: 3, }, + docs: { + enable: true, + }, mail: { provider: 'resend', fromEmail: 'MkSaaS ', diff --git a/src/types/index.d.ts b/src/types/index.d.ts index 6bea8f1..28ea363 100644 --- a/src/types/index.d.ts +++ b/src/types/index.d.ts @@ -13,6 +13,7 @@ export type WebsiteConfig = { auth: AuthConfig; i18n: I18nConfig; blog: BlogConfig; + docs: DocsConfig; mail: MailConfig; newsletter: NewsletterConfig; storage: StorageConfig; @@ -116,6 +117,13 @@ export interface BlogConfig { relatedPostsSize: number; // Number of related posts to show } +/** + * Docs configuration + */ +export interface DocsConfig { + enable: boolean; // Whether to enable the docs +} + /** * Mail configuration */