diff --git a/packages/fdr-sdk/src/navigation/types/NavigationNodePage.ts b/packages/fdr-sdk/src/navigation/types/NavigationNodePage.ts index 48e425180d..6130ac116c 100644 --- a/packages/fdr-sdk/src/navigation/types/NavigationNodePage.ts +++ b/packages/fdr-sdk/src/navigation/types/NavigationNodePage.ts @@ -17,8 +17,9 @@ export function isPage(node: NavigationNode): node is NavigationNodePage { return ( isApiLeaf(node) || node.type === "changelog" || - node.type === "changelogYear" || - node.type === "changelogMonth" || + // TODO: implement changelog pages for year and month + // node.type === "changelogYear" || + // node.type === "changelogMonth" || hasMarkdown(node) ); } diff --git a/packages/ui/docs-bundle/src/pages/api/fern-docs/revalidate-all/v3.ts b/packages/ui/docs-bundle/src/pages/api/fern-docs/revalidate-all/v3.ts index 53257db8b5..5e8468e889 100644 --- a/packages/ui/docs-bundle/src/pages/api/fern-docs/revalidate-all/v3.ts +++ b/packages/ui/docs-bundle/src/pages/api/fern-docs/revalidate-all/v3.ts @@ -76,7 +76,7 @@ const handler: NextApiHandler = async ( const node = FernNavigation.utils.convertLoadDocsForUrlResponse(docs); const slugCollector = NodeCollector.collect(node); - const urls = slugCollector.getSlugs().map((slug) => conformTrailingSlash(urljoin(xFernHost, slug))); + const urls = slugCollector.getPageSlugs().map((slug) => conformTrailingSlash(urljoin(xFernHost, slug))); // when we call res.revalidate() nextjs uses // req.headers.host to make the network request diff --git a/packages/ui/docs-bundle/src/utils/getDocsPageProps.ts b/packages/ui/docs-bundle/src/utils/getDocsPageProps.ts index f96e2b1081..4157436441 100644 --- a/packages/ui/docs-bundle/src/utils/getDocsPageProps.ts +++ b/packages/ui/docs-bundle/src/utils/getDocsPageProps.ts @@ -71,9 +71,9 @@ export async function getDocsPageProps( console.log(`[getDocsPageProps] Fetch completed in ${end - start}ms for ${url}`); if (!docs.ok) { if ((docs.error as any).content.statusCode === 401) { - return { redirect: await getUnauthenticatedRedirect(xFernHost, `/${slug.join("/")}`) }; + return { redirect: await getUnauthenticatedRedirect(xFernHost, `/${slug.join("/")}`), revalidate: 0 }; } else if ((docs.error as any).content.statusCode === 404) { - return { notFound: true }; + return { notFound: true, revalidate: 0 }; } // eslint-disable-next-line no-console @@ -191,6 +191,7 @@ async function convertDocsToDocsPageProps({ destination: conformTrailingSlash(redirect.destination), permanent: redirect.permanent ?? false, }, + revalidate: 0, }; } @@ -208,6 +209,7 @@ async function convertDocsToDocsPageProps({ destination: encodeURI(urljoin("/", root.slug)), permanent: false, }, + revalidate: 0, }; } @@ -229,10 +231,11 @@ async function convertDocsToDocsPageProps({ destination: encodeURI(urljoin("/", node.redirect) || "/"), permanent: false, }, + revalidate: 0, }; } - return { notFound: true }; + return { notFound: true, revalidate: 0 }; } if (node.type === "redirect") { @@ -241,6 +244,7 @@ async function convertDocsToDocsPageProps({ destination: encodeURI(urljoin("/", node.redirect)), permanent: false, }, + revalidate: 0, }; }