@farming-labs/theme 0.2.146 → 0.2.148

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/dist/docs-api.mjs CHANGED
@@ -1029,7 +1029,7 @@ function hasVisibleDescendantDocsSearchPage(dir, reader = createDocsSearchScanRe
1029
1029
  if (pageSource) try {
1030
1030
  const data = reader.document(pageSource).data;
1031
1031
  const hiddenFolderIndex = resolvePageSidebarFolderIndexBehavior(data.sidebar) === "hidden";
1032
- if (data.hidden !== true && !hiddenFolderIndex) return remember(true);
1032
+ if (data.hidden !== true && data.audience !== "agent" && !hiddenFolderIndex) return remember(true);
1033
1033
  } catch {
1034
1034
  return remember(true);
1035
1035
  }
@@ -1119,6 +1119,7 @@ function scanDocsDir(docsDir, entry, locale, excludedDirs = [], publicPath = `/$
1119
1119
  const url = withLangInUrl(publicDocsRoute(publicPath, slugParts), locale);
1120
1120
  indexes.push({
1121
1121
  title,
1122
+ ...data.audience === "agent" ? { audience: "agent" } : {},
1122
1123
  description,
1123
1124
  relatedInput: data.related,
1124
1125
  agent: normalizePageAgentFrontmatter(data.agent),
@@ -237,7 +237,7 @@ function buildTree(config, ctx, reader, flat = false) {
237
237
  docsDir,
238
238
  "page.mdx"
239
239
  ));
240
- if (data.hidden !== true) rootChildren.push({
240
+ if (data.hidden !== true && data.audience !== "agent") rootChildren.push({
241
241
  type: "page",
242
242
  name: data.title ?? "Documentation",
243
243
  url: publicDocsRoute(ctx),
@@ -264,7 +264,7 @@ function buildTree(config, ctx, reader, flat = false) {
264
264
  const displayName = data.title ?? name.replace(/-/g, " ");
265
265
  const folderName = resolveSidebarFolderName(config.theme?.name, name, displayName);
266
266
  const hasChildren = hasChildPages(reader, full, excludedDirs);
267
- if (data.hidden === true) {
267
+ if (data.hidden === true || data.audience === "agent") {
268
268
  if (!hasChildren) return null;
269
269
  return {
270
270
  type: "folder",
@@ -455,25 +455,27 @@ function buildPageMaps(config, ctx, reader, manifest, options) {
455
455
  dir,
456
456
  fileName
457
457
  ));
458
- const route = publicDocsRoute(ctx, slugParts);
459
- const title = typeof data.title === "string" ? data.title : slugParts.at(-1)?.replace(/-/g, " ") || "Documentation";
460
- const description = typeof data.description === "string" ? data.description : void 0;
461
- const manifestLastmod = resolveManifestLastmod(resolveLastmod, ctx, route);
462
- const generatedTitle = resolveGeneratedPageTitle(config.theme, data, content);
463
- if (generatedTitle !== void 0) generatedTitleMap[route] = generatedTitle;
464
- if (fileName === "page.mdx") {
465
- if (dateFormatter) lastModifiedMap[route] = dateFormatter.format(manifestLastmod ? /* @__PURE__ */ new Date(`${manifestLastmod}T00:00:00`) : modifiedAt);
466
- if (description) descriptionMap[route] = description;
467
- const minutes = resolvePageReadingTime(data, (options.enabledByDefault || Object.hasOwn(data, "readingTime")) && data.readingTime !== false && !(typeof data.readingTime === "number" && Number.isFinite(data.readingTime)) ? resolveDocsAudienceMdxContent(content, "human") : "", options);
468
- if (typeof minutes === "number") readingTimeMap[route] = minutes;
458
+ if (data.audience !== "agent") {
459
+ const route = publicDocsRoute(ctx, slugParts);
460
+ const title = typeof data.title === "string" ? data.title : slugParts.at(-1)?.replace(/-/g, " ") || "Documentation";
461
+ const description = typeof data.description === "string" ? data.description : void 0;
462
+ const manifestLastmod = resolveManifestLastmod(resolveLastmod, ctx, route);
463
+ const generatedTitle = resolveGeneratedPageTitle(config.theme, data, content);
464
+ if (generatedTitle !== void 0) generatedTitleMap[route] = generatedTitle;
465
+ if (fileName === "page.mdx") {
466
+ if (dateFormatter) lastModifiedMap[route] = dateFormatter.format(manifestLastmod ? /* @__PURE__ */ new Date(`${manifestLastmod}T00:00:00`) : modifiedAt);
467
+ if (description) descriptionMap[route] = description;
468
+ const minutes = resolvePageReadingTime(data, (options.enabledByDefault || Object.hasOwn(data, "readingTime")) && data.readingTime !== false && !(typeof data.readingTime === "number" && Number.isFinite(data.readingTime)) ? resolveDocsAudienceMdxContent(content, "human") : "", options);
469
+ if (typeof minutes === "number") readingTimeMap[route] = minutes;
470
+ }
471
+ structuredDataPages.pages[route] = compactPageStructuredData({
472
+ title,
473
+ description,
474
+ url: withLangInUrl(route, ctx.locale),
475
+ dateModified: manifestLastmod ? `${manifestLastmod}T00:00:00.000Z` : modifiedAt.toISOString(),
476
+ agent: normalizePageAgentFrontmatter(data.agent)
477
+ });
469
478
  }
470
- structuredDataPages.pages[route] = compactPageStructuredData({
471
- title,
472
- description,
473
- url: withLangInUrl(route, ctx.locale),
474
- dateModified: manifestLastmod ? `${manifestLastmod}T00:00:00.000Z` : modifiedAt.toISOString(),
475
- agent: normalizePageAgentFrontmatter(data.agent)
476
- });
477
479
  }
478
480
  if (options.slugParts) return;
479
481
  for (const name of directories) scan(path.join(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farming-labs/theme",
3
- "version": "0.2.146",
3
+ "version": "0.2.148",
4
4
  "description": "Theme package for @farming-labs/docs — layout, provider, MDX components, and styles",
5
5
  "keywords": [
6
6
  "docs",
@@ -9,6 +9,11 @@
9
9
  "theme"
10
10
  ],
11
11
  "license": "MIT",
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/farming-labs/docs.git",
15
+ "directory": "packages/fumadocs"
16
+ },
12
17
  "author": "Farming Labs",
13
18
  "files": [
14
19
  "dist",
@@ -167,13 +172,13 @@
167
172
  "tsdown": "^0.20.3",
168
173
  "typescript": "^5.9.3",
169
174
  "vitest": "^4.1.8",
170
- "@farming-labs/docs": "0.2.146"
175
+ "@farming-labs/docs": "0.2.148"
171
176
  },
172
177
  "peerDependencies": {
173
178
  "next": ">=16.0.0",
174
179
  "react": ">=19.2.0",
175
180
  "react-dom": ">=19.2.0",
176
- "@farming-labs/docs": "^0.2.146"
181
+ "@farming-labs/docs": "^0.2.148"
177
182
  },
178
183
  "peerDependenciesMeta": {
179
184
  "next": {