@anthusai/papyrus 1.0.0-next.38 → 1.0.0-next.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/app/robots.ts CHANGED
@@ -1,11 +1,8 @@
1
1
  import type { MetadataRoute } from "next";
2
- import { isIndexable } from "../lib/site-env";
2
+ import { buildRobots } from "../lib/robots-policy";
3
3
 
4
4
  export const dynamic = "force-dynamic";
5
5
 
6
6
  export default function robots(): MetadataRoute.Robots {
7
- if (isIndexable()) {
8
- return { rules: { userAgent: "*", allow: "/" } };
9
- }
10
- return { rules: { userAgent: "*", disallow: "/" } };
7
+ return buildRobots();
11
8
  }
@@ -0,0 +1,14 @@
1
+ import type { MetadataRoute } from "next";
2
+ import { getRootRoute, getSiteBrand } from "./site-brand";
3
+ import { isIndexable } from "./site-env";
4
+
5
+ const DISALLOW_ALL: MetadataRoute.Robots = { rules: { userAgent: "*", disallow: "/" } };
6
+ const ALLOW_ALL: MetadataRoute.Robots = { rules: { userAgent: "*", allow: "/" } };
7
+
8
+ export function buildRobots(
9
+ environment: Record<string, string | undefined> = process.env,
10
+ brand = getSiteBrand(),
11
+ ): MetadataRoute.Robots {
12
+ if (getRootRoute(brand).kind === "newsroom") return DISALLOW_ALL;
13
+ return isIndexable(environment) ? ALLOW_ALL : DISALLOW_ALL;
14
+ }
package/package.json CHANGED
@@ -207,6 +207,7 @@
207
207
  "./lib/renderer": "./lib/renderer.ts",
208
208
  "./lib/reporting-story-budget": "./lib/reporting-story-budget.ts",
209
209
  "./lib/revalidate-secret": "./lib/revalidate-secret.ts",
210
+ "./lib/robots-policy": "./lib/robots-policy.ts",
210
211
  "./lib/root-route-redirect": "./lib/root-route-redirect.ts",
211
212
  "./lib/semantic-graph": "./lib/semantic-graph.ts",
212
213
  "./lib/site-brand-tenant": "./lib/site-brand-tenant.ts",
@@ -253,6 +254,7 @@
253
254
  "./app/newsroom/page": "./app/newsroom/page.tsx",
254
255
  "./app/newsroom/sections/[sectionId]/page": "./app/newsroom/sections/[sectionId]/page.tsx",
255
256
  "./app/page": "./app/page.tsx",
257
+ "./app/robots": "./app/robots.ts",
256
258
  "./app/settings/page": "./app/settings/page.tsx"
257
259
  },
258
260
  "files": [
@@ -300,7 +302,7 @@
300
302
  "optional": true
301
303
  }
302
304
  },
303
- "version": "1.0.0-next.38",
305
+ "version": "1.0.0-next.39",
304
306
  "dependencies": {
305
307
  "@aws-amplify/adapter-nextjs": "^1.7.3",
306
308
  "@aws-sdk/client-cognito-identity-provider": "3.1045.0",
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.0-next.38",
2
+ "version": "1.0.0-next.39",
3
3
  "routes": [
4
4
  {
5
5
  "file": "app/%5F_preview/[[...path]]/route.ts",
@@ -197,6 +197,14 @@
197
197
  "dynamic": "\"force-dynamic\""
198
198
  }
199
199
  },
200
+ {
201
+ "file": "app/robots.ts",
202
+ "hasDefault": true,
203
+ "exports": [],
204
+ "config": {
205
+ "dynamic": "\"force-dynamic\""
206
+ }
207
+ },
200
208
  {
201
209
  "file": "app/settings/page.tsx",
202
210
  "reader": true,