@specglass/core 0.0.3 → 0.0.5

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.
@@ -54,13 +54,16 @@ export function defineDocsCollection(options) {
54
54
  export function getSlugFromFilePath(filePath) {
55
55
  // Normalize path separators
56
56
  let slug = filePath.replace(/\\/g, "/");
57
- // Strip leading content/ prefix
57
+ // Strip leading content/ and/or docs/ prefixes.
58
+ // In monorepo context, entry.id is "content/docs/getting-started.mdx".
59
+ // When consumed via npm, the glob loader produces "docs/getting-started.mdx".
58
60
  slug = slug.replace(/^content\//, "");
61
+ slug = slug.replace(/^docs\//, "");
59
62
  // Strip file extension (.mdx or .md)
60
63
  slug = slug.replace(/\.(mdx|md)$/, "");
61
64
  // Handle index files — map to parent directory
62
65
  slug = slug.replace(/\/index$/, "");
63
- // Handle root index (just "index" after stripping content/)
66
+ // Handle root index (just "index" after stripping prefixes)
64
67
  if (slug === "index") {
65
68
  return "";
66
69
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@specglass/core",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "Astro integration, config system, content collections, and OpenAPI spec parsing for Specglass",
5
5
  "type": "module",
6
6
  "license": "MIT",