Skip to content

Commit

Permalink
move noindex location
Browse files Browse the repository at this point in the history
  • Loading branch information
chdeskur committed Mar 8, 2025
1 parent 1340f2b commit 6161b5f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion packages/fern-docs/bundle/src/app/robots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ import urlJoin from "url-join";

import { withDefaultProtocol } from "@fern-api/ui-core-utils";
import { getSeoDisabled } from "@fern-docs/edge-config";
import { HEADER_HOST, HEADER_X_FERN_HOST } from "@fern-docs/utils";
import {
HEADER_HOST,
HEADER_X_FERN_HOST,
conformTrailingSlash,
} from "@fern-docs/utils";

export const runtime = "edge";

Expand Down Expand Up @@ -43,6 +47,7 @@ export default async function robots(): Promise<MetadataRoute.Robots> {
rules: {
userAgent: "*",
allow: "/",
disallow: conformTrailingSlash("*/~explorer"),
},
sitemap,
host: domain,
Expand Down
7 changes: 6 additions & 1 deletion packages/fern-docs/bundle/src/components/shared-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,13 @@ export async function generateMetadata({
(FernNavigation.hasMarkdown(node) && node.noindex) ||
isSeoDisabled ||
frontmatter?.noindex ||
slug.includes("~explorer") ||
false;
const nofollow =
isSeoDisabled ||
frontmatter?.nofollow ||
slug.includes("~explorer") ||
false;
const nofollow = isSeoDisabled || frontmatter?.nofollow || false;

return {
title:
Expand Down

0 comments on commit 6161b5f

Please sign in to comment.