dogsbay 0.2.0-beta.8 → 0.2.0-beta.9

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.
@@ -73,10 +73,17 @@ export function applyDefaults(config) {
73
73
  function fillTaxonomyDefaults(raw) {
74
74
  const out = {};
75
75
  for (const [name, entry] of Object.entries(raw)) {
76
+ // Declaring `prefixes:` (with their own labels / colors) is a strong
77
+ // signal the writer wants `/tags/<prefix>/` to be a real browsable
78
+ // index — not just a styling axis. Default `hierarchical` to true
79
+ // in that case so prefix-index routes get emitted and the
80
+ // breadcrumb / sub-tag links don't 404. Writers can opt out with
81
+ // `hierarchical: false` explicitly.
82
+ const hasPrefixes = entry.prefixes !== undefined && Object.keys(entry.prefixes).length > 0;
76
83
  out[name] = {
77
84
  indexPath: entry.indexPath ?? `/${name}`,
78
85
  values: entry.values,
79
- hierarchical: entry.hierarchical ?? false,
86
+ hierarchical: entry.hierarchical ?? hasPrefixes,
80
87
  prefixes: entry.prefixes,
81
88
  labels: entry.labels,
82
89
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dogsbay",
3
- "version": "0.2.0-beta.8",
3
+ "version": "0.2.0-beta.9",
4
4
  "description": "CLI for Dogsbay — scaffold, build, and serve documentation sites with markdown / MkDocs / Obsidian / OpenAPI sources",
5
5
  "type": "module",
6
6
  "bin": {
@@ -31,14 +31,14 @@
31
31
  "picocolors": "^1.1.0",
32
32
  "prompts": "^2.4.2",
33
33
  "yaml": "^2.8.3",
34
- "@dogsbay/format-mkdocs": "0.2.0-beta.8",
35
- "@dogsbay/format-astro": "0.2.0-beta.8",
36
- "@dogsbay/format-obsidian": "0.2.0-beta.8",
37
- "@dogsbay/format-mdx": "0.2.0-beta.8",
38
- "@dogsbay/format-starlight": "0.2.0-beta.8",
39
- "@dogsbay/format-dogsbay-md": "0.2.0-beta.8",
40
- "@dogsbay/format-openapi": "0.2.0-beta.8",
41
- "@dogsbay/types": "0.2.0-beta.8"
34
+ "@dogsbay/format-mkdocs": "0.2.0-beta.9",
35
+ "@dogsbay/format-obsidian": "0.2.0-beta.9",
36
+ "@dogsbay/format-astro": "0.2.0-beta.9",
37
+ "@dogsbay/format-mdx": "0.2.0-beta.9",
38
+ "@dogsbay/format-starlight": "0.2.0-beta.9",
39
+ "@dogsbay/format-dogsbay-md": "0.2.0-beta.9",
40
+ "@dogsbay/format-openapi": "0.2.0-beta.9",
41
+ "@dogsbay/types": "0.2.0-beta.9"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/node": "^22.0.0",
@@ -106,6 +106,37 @@ This is the slot for "we want categories of tags but don't want
106
106
  to invent five separate frontmatter fields." Slash separation
107
107
  is the convention; the parser doesn't enforce it.
108
108
 
109
+ ### `hierarchical:` controls prefix browsing
110
+
111
+ When `hierarchical: true`, declaring tag `concept/rag` also
112
+ emits a `/tags/concept/` browse page that aggregates every
113
+ `concept/*` tag. Term-page breadcrumbs (`Tags / Concept / RAG`)
114
+ become clickable.
115
+
116
+ When `hierarchical: false`, only leaf-tag pages (`/tags/concept/rag/`)
117
+ exist; the prefix is purely visual styling on chips.
118
+
119
+ **The default is auto-derived:** when you declare `prefixes:`,
120
+ `hierarchical` defaults to `true` (the writer signalled they
121
+ want prefixes to be real browsable categories). When
122
+ `prefixes:` is absent, `hierarchical` defaults to `false`. Set
123
+ the flag explicitly to override.
124
+
125
+ ```yaml
126
+ # Auto-hierarchical — prefixes declared, /tags/concept/ exists
127
+ taxonomies:
128
+ tags:
129
+ prefixes:
130
+ concept: { color: blue }
131
+
132
+ # Flat — prefixes are pure styling, /tags/concept/ does NOT exist
133
+ taxonomies:
134
+ tags:
135
+ hierarchical: false
136
+ prefixes:
137
+ concept: { color: blue }
138
+ ```
139
+
109
140
  ## Closed-list taxonomies
110
141
 
111
142
  `values:` makes a taxonomy closed — pages declaring a value