@sit-onyx/nuxt-docs 0.8.0-dev-20261005152433 → 0.8.0-dev-20261006142522
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/app/error.vue +19 -16
- package/app/pages/[...slug].vue +11 -3
- package/content.config.ts +4 -1
- package/package.json +3 -3
package/app/error.vue
CHANGED
|
@@ -27,26 +27,29 @@ const _clearError = () => clearError({ redirect: localePath("/") });
|
|
|
27
27
|
|
|
28
28
|
<template>
|
|
29
29
|
<App>
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
<!-- error.vue does only support layouts using "NuxtLayout", see: https://nuxt.com/docs/4.x/directory-structure/app/error -->
|
|
31
|
+
<NuxtLayout name="sidebar">
|
|
32
|
+
<div class="error">
|
|
33
|
+
<OnyxErrorSVG class="error__image" />
|
|
32
34
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
<div class="error__headline">
|
|
36
|
+
<OnyxHeadline is="h1">{{ props.error.message }}</OnyxHeadline>
|
|
35
37
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
<slot name="actions" :clear-error="_clearError">
|
|
39
|
+
<OnyxButton label="Back to home" @click="_clearError" />
|
|
40
|
+
</slot>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<slot name="details">
|
|
44
|
+
<OnyxAccordion>
|
|
45
|
+
<OnyxAccordionItem value="details">
|
|
46
|
+
<template #header>Technical error details</template>
|
|
47
|
+
<pre class="error__details">{{ JSON.stringify(props.error, null, 2) }}</pre>
|
|
48
|
+
</OnyxAccordionItem>
|
|
49
|
+
</OnyxAccordion>
|
|
38
50
|
</slot>
|
|
39
51
|
</div>
|
|
40
|
-
|
|
41
|
-
<slot name="details">
|
|
42
|
-
<OnyxAccordion>
|
|
43
|
-
<OnyxAccordionItem value="details">
|
|
44
|
-
<template #header>Technical error details</template>
|
|
45
|
-
<pre class="error__details">{{ JSON.stringify(props.error, null, 2) }}</pre>
|
|
46
|
-
</OnyxAccordionItem>
|
|
47
|
-
</OnyxAccordion>
|
|
48
|
-
</slot>
|
|
49
|
-
</div>
|
|
52
|
+
</NuxtLayout>
|
|
50
53
|
</App>
|
|
51
54
|
</template>
|
|
52
55
|
|
package/app/pages/[...slug].vue
CHANGED
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { Collections } from "@nuxt/content";
|
|
3
|
+
import type { NuxtLayouts } from "#app";
|
|
3
4
|
|
|
4
|
-
definePageMeta({ layout:
|
|
5
|
+
definePageMeta({ layout: false });
|
|
5
6
|
|
|
6
7
|
const { locale } = useI18n();
|
|
7
8
|
|
|
8
9
|
const { data } = await useCollection({
|
|
9
10
|
collection: computed(() => `content_${locale.value}` as keyof Collections),
|
|
10
11
|
});
|
|
12
|
+
|
|
13
|
+
const layout = computed<keyof NuxtLayouts>(() => {
|
|
14
|
+
const layout = data.value?.meta.layout;
|
|
15
|
+
if (layout && typeof layout === "string") return layout as keyof NuxtLayouts;
|
|
16
|
+
return "sidebar";
|
|
17
|
+
});
|
|
11
18
|
</script>
|
|
12
19
|
|
|
13
|
-
<!-- eslint-disable-next-line vue/no-root-v-if -- The "useCollection" will already redirect to the error page when the data is undefined but the data might still be undefined while e.g. switching to another page -->
|
|
14
20
|
<template>
|
|
15
|
-
<
|
|
21
|
+
<NuxtLayout :name="layout">
|
|
22
|
+
<ContentRenderer v-if="data" :value="data" />
|
|
23
|
+
</NuxtLayout>
|
|
16
24
|
</template>
|
package/content.config.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import { defineCollection, defineContentConfig } from "@nuxt/content";
|
|
2
|
+
import { defineCollection, defineContentConfig, z } from "@nuxt/content";
|
|
3
3
|
|
|
4
4
|
export default defineContentConfig({
|
|
5
5
|
collections: {
|
|
@@ -11,6 +11,9 @@ export default defineContentConfig({
|
|
|
11
11
|
// include files from playground (mainly needed for this monorepo)
|
|
12
12
|
{ cwd: path.resolve("playground/content"), include: "en/**", prefix: "/" },
|
|
13
13
|
],
|
|
14
|
+
schema: z.object({
|
|
15
|
+
layout: z.string().optional(),
|
|
16
|
+
}),
|
|
14
17
|
}),
|
|
15
18
|
},
|
|
16
19
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sit-onyx/nuxt-docs",
|
|
3
|
-
"version": "0.8.0-dev-
|
|
3
|
+
"version": "0.8.0-dev-20261006142522",
|
|
4
4
|
"description": "Nuxt layer/template for creating documentations with the onyx design system",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/SchwarzIT/onyx/issues"
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@sit-onyx/shared": "^0.1.0",
|
|
38
38
|
"nuxt": "4.5.2",
|
|
39
39
|
"sass-embedded": "1.104.1",
|
|
40
|
-
"sit-onyx": "^1.21.1-dev-
|
|
40
|
+
"sit-onyx": "^1.21.1-dev-20261006142522",
|
|
41
41
|
"typescript": "6.0.3",
|
|
42
42
|
"vue": "3.5.43"
|
|
43
43
|
},
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@sit-onyx/icons": "^1.12.0",
|
|
52
52
|
"@sit-onyx/nuxt": "^1.1.2",
|
|
53
53
|
"sass-embedded": ">= 1",
|
|
54
|
-
"sit-onyx": "^1.21.1-dev-
|
|
54
|
+
"sit-onyx": "^1.21.1-dev-20261006142522"
|
|
55
55
|
},
|
|
56
56
|
"engines": {
|
|
57
57
|
"node": ">=20"
|