Skip to content

Commit 2c4a371

Browse files
Attempt 2 at fixing Shiki (#99)
* Add vercel to gitignore * Try it with transpilation instead * Update dependencies * Temp disable prerender * Prerender without dynamic og
1 parent 2c27307 commit 2c4a371

13 files changed

+42
-105
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ logs
2424
!.env.example
2525

2626
.netlify
27+
.vercel

app/app.vue

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ const { data: navigation } = useAsyncData('navigation', () => fetchContentNaviga
55
66
provide('openapi', spec);
77
provide('navigation', navigation);
8+
9+
defineOgImage({
10+
url: '/img/og-image.png',
11+
});
812
</script>
913

1014
<template>

app/pages/[...slug].vue

-8
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,6 @@ if (!page.value) {
1515
const headline = computed(() => findPageHeadline(page.value!));
1616
1717
const { data: surround } = await useAsyncData(`${route.path}-surround`, () => queryContent().where({ _extension: 'md', navigation: { $ne: false } }).only(['title', 'description', '_path']).findSurround(withoutTrailingSlash(route.path)));
18-
19-
defineOgImage({
20-
component: 'OgImageDefault',
21-
props: {
22-
title: page.value.title,
23-
breadcrumb: pageBreadcrumb(page.value._path!),
24-
},
25-
});
2618
</script>
2719

2820
<template>

app/pages/api/[tag].vue

-8
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,6 @@ const operations = computed<FlattenedOperationObject<DerefedOperationObject>[]>(
3939
if (!tag.value) {
4040
throw createError({ statusCode: 404, statusMessage: 'Page not found', fatal: true });
4141
}
42-
43-
defineOgImage({
44-
component: 'OgImageDefault',
45-
props: {
46-
title: tag.value.name,
47-
breadcrumb: ['api'],
48-
},
49-
});
5042
</script>
5143

5244
<template>

app/pages/api/index.vue

-8
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,6 @@ const openapi = inject<OpenAPIObject>('openapi')!;
1313
if (!page.value) {
1414
throw createError({ statusCode: 404, statusMessage: 'Page not found', fatal: true });
1515
}
16-
17-
defineOgImage({
18-
component: 'OgImageDefault',
19-
props: {
20-
title: page.value.title,
21-
breadcrumb: pageBreadcrumb(page.value._path!),
22-
},
23-
});
2416
</script>
2517

2618
<template>

app/pages/index.vue

-7
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,6 @@ if (!page.value) {
1111
fatal: true,
1212
});
1313
}
14-
15-
defineOgImage({
16-
component: 'OgImageDefault',
17-
props: {
18-
title: page.value.title,
19-
},
20-
});
2114
</script>
2215

2316
<template>

app/pages/tutorials/[category]/[...slug].vue

-8
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,6 @@ const { data: page } = await useAsyncData(route.path, () => queryContent(route.p
99
if (!page.value) {
1010
throw createError({ statusCode: 404, statusMessage: 'Page not found', fatal: true });
1111
}
12-
13-
defineOgImage({
14-
component: 'OgImageDefault',
15-
props: {
16-
title: page.value.title,
17-
breadcrumb: pageBreadcrumb(page.value._path!),
18-
},
19-
});
2012
</script>
2113

2214
<template>

app/pages/tutorials/[category]/index.vue

-8
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,6 @@ const { data: page } = await useAsyncData(route.path, () => queryContent(route.p
99
if (!page.value) {
1010
throw createError({ statusCode: 404, statusMessage: 'Page not found', fatal: true });
1111
}
12-
13-
defineOgImage({
14-
component: 'OgImageDefault',
15-
props: {
16-
title: page.value.title,
17-
breadcrumb: pageBreadcrumb(page.value._path!),
18-
},
19-
});
2012
</script>
2113

2214
<template>

app/pages/tutorials/index.vue

-8
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,6 @@ const { data: categories } = await useAsyncData(route.path + '-categories', () =
1111
if (!page.value) {
1212
throw createError({ statusCode: 404, statusMessage: 'Page not found', fatal: true });
1313
}
14-
15-
defineOgImage({
16-
component: 'OgImageDefault',
17-
props: {
18-
title: page.value.title,
19-
breadcrumb: pageBreadcrumb(page.value._path!),
20-
},
21-
});
2214
</script>
2315

2416
<template>

nuxt.config.ts

+4-17
Original file line numberDiff line numberDiff line change
@@ -87,17 +87,17 @@ export default defineNuxtConfig({
8787
},
8888
},
8989

90+
build: {
91+
transpile: ['shiki'],
92+
},
93+
9094
future: {
9195
compatibilityVersion: 4,
9296
},
9397

9498
compatibilityDate: '2024-11-01',
9599

96100
nitro: {
97-
// preset: 'static',
98-
// output: {
99-
// publicDir: '.output/public/docs',
100-
// },
101101
prerender: {
102102
routes: [
103103
'/',
@@ -112,19 +112,6 @@ export default defineNuxtConfig({
112112
},
113113
},
114114

115-
vite: {
116-
build: {
117-
rollupOptions: {
118-
external: [
119-
'shiki/onig.wasm',
120-
],
121-
},
122-
},
123-
assetsInclude: [
124-
'**/*.wasm',
125-
],
126-
},
127-
128115
algolia: {
129116
docSearch: {
130117
indexName: 'directus',

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@
1515
"@docsearch/js": "3.8.2",
1616
"@iconify-json/heroicons-outline": "1.2.1",
1717
"@iconify-json/material-symbols": "1.2.12",
18-
"@iconify-json/simple-icons": "1.2.16",
18+
"@iconify-json/simple-icons": "1.2.17",
1919
"@nuxt/content": "2.13.4",
2020
"@nuxt/eslint": "0.7.4",
2121
"@nuxt/scripts": "0.9.5",
2222
"@nuxt/ui-pro": "1.6.0",
2323
"@nuxtjs/color-mode": "^3.5.2",
2424
"@nuxtjs/seo": "2.0.2",
2525
"@nuxtjs/tailwindcss": "6.12.2",
26-
"@vueuse/core": "12.1.0",
27-
"@vueuse/nuxt": "12.1.0",
26+
"@vueuse/core": "12.2.0",
27+
"@vueuse/nuxt": "12.2.0",
2828
"lodash-es": "4.17.21",
2929
"nuxt": "^3.14.1592",
3030
"nuxt-posthog": "1.6.1",

pnpm-lock.yaml

+30-30
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.

0 commit comments

Comments
 (0)