@paroicms/site-generator-plugin 0.23.0 → 0.24.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.
@@ -10,7 +10,7 @@ export async function fillSiteWithFakeContent(ctx, stepHandle, { regSite, locali
10
10
  const { service } = ctx;
11
11
  const { fqdn } = regSite;
12
12
  const report = createGeneratedContentReport();
13
- const { siteSchema, siteIds } = await service.connector.loadSiteSchemaAndIds(fqdn);
13
+ const { siteSchema, homeRoutingCluster } = await service.connector.loadSiteSchemaAndIds(fqdn);
14
14
  const schemaI18n = createSimpleTranslator({
15
15
  labels: siteSchema.l10n,
16
16
  logger: ctx.logger,
@@ -22,7 +22,7 @@ export async function fillSiteWithFakeContent(ctx, stepHandle, { regSite, locali
22
22
  siteSchema,
23
23
  schemaI18n,
24
24
  }, {
25
- routingIds: siteIds.homeIds,
25
+ clusterNode: homeRoutingCluster,
26
26
  nodeType: siteSchema.nodeTypes.home,
27
27
  });
28
28
  const { promise } = tasks.runAll({ maxParallel: 10, rateLimitPerSecond: 3 });
@@ -46,14 +46,14 @@ export async function fillSiteWithFakeContent(ctx, stepHandle, { regSite, locali
46
46
  });
47
47
  }
48
48
  function fillRoutingDocumentAndAddChildren(ctx, tasks, report, siteOptions, nodeOptions) {
49
- const { routingIds, nodeType } = nodeOptions;
49
+ const { clusterNode, nodeType } = nodeOptions;
50
50
  const { siteSchema } = siteOptions;
51
51
  tasks.add(() => updateRoutingDocument(ctx, report, siteOptions, nodeOptions));
52
52
  for (const listType of nodeType.lists ?? []) {
53
53
  for (const typeName of listType.parts) {
54
54
  const partType = getPartTypeByName(siteSchema, typeName);
55
55
  tasks.add(() => addParts(ctx, report, siteOptions, {
56
- parentNodeId: routingIds.nodeId,
56
+ parentNodeId: clusterNode.nodeId,
57
57
  nodeType: partType,
58
58
  documentType: nodeType,
59
59
  }));
@@ -61,18 +61,18 @@ function fillRoutingDocumentAndAddChildren(ctx, tasks, report, siteOptions, node
61
61
  }
62
62
  for (const typeName of nodeType.routingChildren ?? []) {
63
63
  const childType = getRoutingDocumentTypeByName(siteSchema, typeName);
64
- const childIds = routingIds.children?.[typeName];
64
+ const childIds = clusterNode.children?.[typeName];
65
65
  if (!childIds)
66
66
  throw new Error(`Missing childIds for ${typeName}`);
67
67
  fillRoutingDocumentAndAddChildren(ctx, tasks, report, siteOptions, {
68
- routingIds: childIds,
68
+ clusterNode: childIds,
69
69
  nodeType: childType,
70
70
  });
71
71
  }
72
72
  for (const typeName of nodeType.regularChildren ?? []) {
73
73
  const childType = getRegularDocumentTypeByName(siteSchema, typeName);
74
74
  tasks.add(() => addRegularDocuments(ctx, report, siteOptions, {
75
- parentNodeId: routingIds.nodeId,
75
+ parentNodeId: clusterNode.nodeId,
76
76
  nodeType: childType,
77
77
  documentType: childType,
78
78
  }));
@@ -2,7 +2,7 @@ import { dedupMessages } from "./content-helpers.js";
2
2
  import { generateFieldSetContent, generateMultipleFieldSetContents, } from "./generate-fake-content.js";
3
3
  export async function updateRoutingDocument(ctx, report, siteOptions, nodeOptions) {
4
4
  ctx.logger.debug(`[TASK] Updating routing document "${nodeOptions.nodeType.typeName}"…`);
5
- const { routingIds, nodeType } = nodeOptions;
5
+ const { clusterNode, nodeType } = nodeOptions;
6
6
  const { fqdn, siteSchema, schemaI18n } = siteOptions;
7
7
  const content = await generateFieldSetContent(ctx, {
8
8
  nodeType,
@@ -13,14 +13,14 @@ export async function updateRoutingDocument(ctx, report, siteOptions, nodeOption
13
13
  llmTaskName: nodeType.kebabName,
14
14
  }, report);
15
15
  await ctx.service.connector.updateNodeContent(fqdn, {
16
- nodeId: routingIds.nodeId,
16
+ nodeId: clusterNode.nodeId,
17
17
  content: toRiDocumentContent(content, nodeType),
18
18
  });
19
19
  for (const language of siteSchema.languages) {
20
20
  report.addId({
21
21
  typeName: nodeType.typeName,
22
22
  id: {
23
- nodeId: routingIds.nodeId,
23
+ nodeId: clusterNode.nodeId,
24
24
  language,
25
25
  },
26
26
  parentNodeId: undefined,
@@ -4,10 +4,15 @@ export function templateOfDocumentBreadcrumb() {
4
4
  return `{% if doc.breadcrumb %}
5
5
  <div class="Container">
6
6
  {% for crumb in doc.breadcrumb %}
7
- <a class="TextLink" href="{{ crumb.url }}">{{ crumb.title }}</a>
8
- /
7
+ {% if crumb.url %}
8
+ <a class="TextLink" href="{{ crumb.url }}">{{ crumb.title }}</a>
9
+ {% else %}
10
+ <span>{{ crumb.title }}</span>
11
+ {% endif %}
12
+ {% unless forloop.last %}
13
+ /
14
+ {% endunless %}
9
15
  {% endfor %}
10
- {{ doc.title }}
11
16
  </div>
12
17
  {% endif %}`;
13
18
  }
@@ -221,19 +221,25 @@ function toPartNodeType(typeName) {
221
221
  };
222
222
  }
223
223
  function toRoutingDocumentNodeType(typeName, saType) {
224
- return {
224
+ const documentType = {
225
225
  typeName,
226
226
  kind: "document",
227
227
  documentKind: "routing",
228
228
  ogType: saType.ogType,
229
229
  route: generateSlug(saType.label),
230
230
  withFeaturedImage: typeName !== "home" && !!saType.entryPage,
231
- adminUi: saType.taxonomy
232
- ? {
233
- menuPlacement: "popup",
234
- }
235
- : undefined,
236
231
  };
232
+ if (typeName === "home") {
233
+ documentType.cluster = {
234
+ autoCreate: true,
235
+ };
236
+ }
237
+ if (saType.taxonomy) {
238
+ documentType.adminUi = {
239
+ menuPlacement: "popup",
240
+ };
241
+ }
242
+ return documentType;
237
243
  }
238
244
  function toRegularDocumentNodeType(typeName, saType) {
239
245
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paroicms/site-generator-plugin",
3
- "version": "0.23.0",
3
+ "version": "0.24.0",
4
4
  "description": "ParoiCMS Site Generator Plugin",
5
5
  "keywords": [
6
6
  "paroicms",
@@ -30,7 +30,7 @@
30
30
  "dependencies": {
31
31
  "@anthropic-ai/sdk": "~0.54.0",
32
32
  "@mistralai/mistralai": "~1.7.2",
33
- "@paroicms/script-lib": "0.2.0",
33
+ "@paroicms/script-lib": "0.2.1",
34
34
  "arktype": "~2.1.20",
35
35
  "jsonwebtoken": "~9.0.2",
36
36
  "knex": "~3.1.0",
@@ -44,9 +44,9 @@
44
44
  "@paroicms/public-server-lib": "0"
45
45
  },
46
46
  "devDependencies": {
47
- "@paroicms/internal-anywhere-lib": "1.33.0",
48
- "@paroicms/internal-server-lib": "1.20.0",
49
- "@paroicms/public-server-lib": "0.44.0",
47
+ "@paroicms/internal-anywhere-lib": "1.34.0",
48
+ "@paroicms/internal-server-lib": "1.20.1",
49
+ "@paroicms/public-server-lib": "0.45.0",
50
50
  "@types/node": "~24.0.1",
51
51
  "marked": "~15.0.12",
52
52
  "nodemon": "~3.1.10",