@griddo/cx 11.14.4 → 11.14.5-rc.0

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/build/index.js CHANGED
@@ -25328,7 +25328,7 @@ var SITE_URI = `${GRIDDO_API_URL2}/site/`;
25328
25328
  var package_default = {
25329
25329
  name: "@griddo/cx",
25330
25330
  description: "Griddo SSG based on Gatsby",
25331
- version: "11.14.4",
25331
+ version: "11.14.5-rc.0",
25332
25332
  authors: [
25333
25333
  "Hisco <francis.vega@griddo.io>"
25334
25334
  ],
@@ -25389,7 +25389,7 @@ var package_default = {
25389
25389
  },
25390
25390
  devDependencies: {
25391
25391
  "@biomejs/biome": "2.3.4",
25392
- "@griddo/core": "11.14.4",
25392
+ "@griddo/core": "11.14.5-rc.0",
25393
25393
  "@types/node": "20.19.4",
25394
25394
  "@typescript/native-preview": "7.0.0-dev.20260401.1",
25395
25395
  cheerio: "1.1.2",
@@ -25423,7 +25423,7 @@ var package_default = {
25423
25423
  publishConfig: {
25424
25424
  access: "public"
25425
25425
  },
25426
- gitHead: "3805bd9b387f46f81276d70322d3c7cb2b46a6dd"
25426
+ gitHead: "35106a4e094a9b210ac358d51ad5a2d80dbc6a2d"
25427
25427
  };
25428
25428
 
25429
25429
  // exporter/shared/headers.ts
@@ -55,7 +55,7 @@ type Domains = Domain[];
55
55
  type BuildProcessData = Record<string, EndSiteRenderBody>;
56
56
  type Robot = {
57
57
  path: string;
58
- content: string;
58
+ computedContent: string;
59
59
  };
60
60
  type Robots = Robot[];
61
61
  type LLMs = {
@@ -5,7 +5,7 @@ import type { Footer, Header } from "./navigation";
5
5
  * Describes a Griddo site object from API.
6
6
  * This takes some type props from Core.Site.
7
7
  */
8
- export interface Site extends Required<Pick<Core.Site, "bigAvatar" | "favicon" | "home" | "id" | "isPublished" | "timezone" | "thumbnail" | "theme" | "socials" | "slug" | "smallAvatar" | "modified" | "name" | "siteMetadata">> {
8
+ export interface Site extends Required<Pick<Core.Site, "bigAvatar" | "favicon" | "home" | "id" | "isPublished" | "timezone" | "thumbnail" | "theme" | "socials" | "slug" | "smallAvatar" | "modified" | "name" | "siteMetadata" | "hidden">> {
9
9
  author: string;
10
10
  deleted: number;
11
11
  domains: Record<string, string>[];
@@ -11,14 +11,10 @@ import { getRenderPathsHydratedWithDomainFromDB } from "./render";
11
11
 
12
12
  async function fetchRobots() {
13
13
  const apiRobots = await get<Robots>({ endpoint: ROBOTS });
14
- return (
15
- apiRobots
16
- ?.filter((r) => !!r.path)
17
- .map(({ path, content }) => ({
18
- path,
19
- content: content || "User-agent: *\n\r\n\rAllow: /",
20
- })) || []
21
- );
14
+
15
+ if (!apiRobots) return [];
16
+
17
+ return apiRobots.filter((robot) => !!robot.path);
22
18
  }
23
19
 
24
20
  async function generateRobots(domain: string) {
@@ -32,9 +28,10 @@ async function generateRobots(domain: string) {
32
28
  }
33
29
 
34
30
  if (await pathExists(distDirectory)) {
35
- const fileLocation = path.join(distDirectory, "robots.txt");
36
- await fsp.writeFile(fileLocation, robot?.content);
37
- GriddoLog.verbose(`wrote robots.txt to ${fileLocation}`);
31
+ const filePath = path.join(distDirectory, "robots.txt");
32
+ const content = robot.computedContent;
33
+ await fsp.writeFile(filePath, content);
34
+ GriddoLog.verbose(`wrote robots.txt to ${filePath}`);
38
35
  } else {
39
36
  GriddoLog.info(`${distDirectory} not found`);
40
37
  }
@@ -116,7 +116,7 @@ async function createStore(options: {
116
116
  }
117
117
 
118
118
  for (const site of sitesToPublish) {
119
- const { id: siteId, slug: siteSlug, theme, favicon, pagesStatus } = site;
119
+ const { id: siteId, slug: siteSlug, theme, favicon, pagesStatus, hidden } = site;
120
120
  const siteDirName = siteId.toString();
121
121
 
122
122
  // Snapshot of real pending-to-upload IDs before FROM_SCRATCH merges
@@ -311,6 +311,14 @@ async function createStore(options: {
311
311
  griddoPageObjects = [await createGriddoSinglePage(griddoSinglePage, pageAdditionalInfo)];
312
312
  }
313
313
 
314
+ // Manage hidden sites: set noindex for all pages if site is hidden
315
+ if (hidden) {
316
+ griddoPageObjects.forEach((pageObject) => {
317
+ pageObject.context.pageMetadata.index = "noindex";
318
+ pageObject.context.pageMetadata.follow = "nofollow";
319
+ });
320
+ }
321
+
314
322
  // Upload only the valid pages hashes or ids of pages that has
315
323
  // been changed or created.
316
324
  if (page.hash !== null) {
@@ -61,7 +61,7 @@ type Domains = Domain[];
61
61
  /** Describes the type of build process data object. */
62
62
  type BuildProcessData = Record<string, EndSiteRenderBody>;
63
63
 
64
- type Robot = { path: string; content: string };
64
+ type Robot = { path: string; computedContent: string };
65
65
 
66
66
  type Robots = Robot[];
67
67
 
@@ -24,6 +24,7 @@ export interface Site
24
24
  | "modified"
25
25
  | "name"
26
26
  | "siteMetadata"
27
+ | "hidden"
27
28
  >
28
29
  > {
29
30
  author: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@griddo/cx",
3
3
  "description": "Griddo SSG based on Gatsby",
4
- "version": "11.14.4",
4
+ "version": "11.14.5-rc.0",
5
5
  "authors": [
6
6
  "Hisco <francis.vega@griddo.io>"
7
7
  ],
@@ -62,7 +62,7 @@
62
62
  },
63
63
  "devDependencies": {
64
64
  "@biomejs/biome": "2.3.4",
65
- "@griddo/core": "11.14.4",
65
+ "@griddo/core": "11.14.5-rc.0",
66
66
  "@types/node": "20.19.4",
67
67
  "@typescript/native-preview": "7.0.0-dev.20260401.1",
68
68
  "cheerio": "1.1.2",
@@ -96,5 +96,5 @@
96
96
  "publishConfig": {
97
97
  "access": "public"
98
98
  },
99
- "gitHead": "3805bd9b387f46f81276d70322d3c7cb2b46a6dd"
99
+ "gitHead": "35106a4e094a9b210ac358d51ad5a2d80dbc6a2d"
100
100
  }