@farming-labs/theme 0.1.68 → 0.1.70

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.
@@ -152,7 +152,7 @@ function buildTree(config, ctx, flat = false) {
152
152
  const excludedDirs = getExcludedDocsDirs(config, ctx);
153
153
  if (fs.existsSync(path.join(docsDir, "page.mdx"))) {
154
154
  const data = readFrontmatter(path.join(docsDir, "page.mdx"));
155
- rootChildren.push({
155
+ if (data.hidden !== true) rootChildren.push({
156
156
  type: "page",
157
157
  name: data.title ?? "Documentation",
158
158
  url: `/${ctx.entryPath}`,
@@ -170,7 +170,21 @@ function buildTree(config, ctx, flat = false) {
170
170
  const url = `/${ctx.entryPath}/${slug.join("/")}`;
171
171
  const icon = resolveIcon(data.icon, icons);
172
172
  const displayName = data.title ?? name.replace(/-/g, " ");
173
- if (hasChildPages(full, excludedDirs)) {
173
+ const hasChildren = hasChildPages(full, excludedDirs);
174
+ if (data.hidden === true) {
175
+ if (!hasChildren) return null;
176
+ return {
177
+ type: "folder",
178
+ name: displayName,
179
+ icon,
180
+ children: scanDir(full, slug, slugOrder),
181
+ ...flat ? {
182
+ collapsible: false,
183
+ defaultOpen: true
184
+ } : {}
185
+ };
186
+ }
187
+ if (hasChildren) {
174
188
  const folderChildren = scanDir(full, slug, slugOrder);
175
189
  return {
176
190
  type: "folder",
@@ -14,7 +14,7 @@ interface FolderNode {
14
14
  name: string;
15
15
  icon?: ReactNode;
16
16
  index?: PageNode;
17
- folderIndexBehavior?: "link" | "toggle";
17
+ folderIndexBehavior?: "link" | "toggle" | "hidden";
18
18
  children: (PageNode | FolderNode)[];
19
19
  collapsible?: boolean;
20
20
  defaultOpen?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farming-labs/theme",
3
- "version": "0.1.68",
3
+ "version": "0.1.70",
4
4
  "description": "Theme package for @farming-labs/docs — layout, provider, MDX components, and styles",
5
5
  "keywords": [
6
6
  "docs",
@@ -139,7 +139,7 @@
139
139
  "tsdown": "^0.20.3",
140
140
  "typescript": "^5.9.3",
141
141
  "vitest": "^3.2.4",
142
- "@farming-labs/docs": "0.1.68"
142
+ "@farming-labs/docs": "0.1.70"
143
143
  },
144
144
  "peerDependencies": {
145
145
  "@farming-labs/docs": ">=0.0.1",