@baybreezy/docd 0.0.11 → 0.0.12

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.
@@ -59,11 +59,15 @@
59
59
  * Optional icon name to display next to the filename
60
60
  */
61
61
  icon?: string;
62
+ /**
63
+ * Format the filename: strip the file extension and apply title case
64
+ */
65
+ format?: boolean;
62
66
  }>();
63
67
 
64
68
  /**
65
69
  * Parse meta string and create a lowercase key map for easy checking
66
- * Example: "noFormat hideHeader icon='lucide:code'" => Map { 'noformat' => true, 'hideheader' => true, 'icon' => 'lucide:code' }
70
+ * Example: "format hideHeader icon='lucide:code'" => Map { 'format' => true, 'hideheader' => true, 'icon' => 'lucide:code' }
67
71
  */
68
72
  const metaMap = computed(() => {
69
73
  const map = new Map<string, string | boolean>();
@@ -90,7 +94,7 @@
90
94
  });
91
95
 
92
96
  const hideCopyButton = ref(false);
93
- const noFormatMeta = computed(() => metaMap.value.has("noformat"));
97
+ const formatMeta = computed(() => metaMap.value.has("format"));
94
98
  const hideHeaderMeta = computed(
95
99
  () => metaMap.value.has("hideheader") || metaMap.value.has("noheader")
96
100
  );
@@ -107,7 +111,7 @@
107
111
 
108
112
  const fileNameEdited = computed(() => {
109
113
  if (!props.filename) return;
110
- if (noFormatMeta.value) return props.filename;
114
+ if (!props.format && !formatMeta.value) return props.filename;
111
115
 
112
116
  let processedName = props.filename;
113
117
 
@@ -10,7 +10,7 @@ export const useDocPage = async () => {
10
10
 
11
11
  const [{ data: page }, { data: surround }, { data: navigation }] = await Promise.all([
12
12
  useAsyncData(
13
- kebabCase(route.path),
13
+ kebabCase(route.path) || "root",
14
14
  () =>
15
15
  isLandingRoute
16
16
  ? queryCollection("landing" as keyof Collections)
@@ -22,7 +22,7 @@ export const useDocPage = async () => {
22
22
  { watch: [() => route.path] }
23
23
  ),
24
24
  useAsyncData(
25
- `${kebabCase(route.path)}-surround`,
25
+ `${kebabCase(route.path) || "root"}-surround`,
26
26
  () => {
27
27
  if (isLandingRoute) {
28
28
  return Promise.resolve(null);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baybreezy/docd",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "description": "A Nuxt layer for building documentation sites with UI Thing.",
5
5
  "repository": {
6
6
  "type": "git",