mirror of
https://iceshrimp.dev/Crimekillz/jointrashposs.git
synced 2024-11-22 00:43:50 +01:00
(temp workaround) build
This commit is contained in:
parent
14d050b05d
commit
aebc9b6f07
@ -97,7 +97,9 @@ export default defineNuxtConfig({
|
||||
prerender: {
|
||||
routes: [
|
||||
"/404.html"
|
||||
]
|
||||
],
|
||||
// 【一時対応】とりあえずビルドできるようにする
|
||||
failOnError: false,
|
||||
},
|
||||
plugins: [
|
||||
'@/server/plugins/appendComment.ts',
|
||||
|
@ -29,7 +29,9 @@ definePageMeta({
|
||||
});
|
||||
|
||||
defineI18nRoute({
|
||||
locales: (locales.value as LocaleObject[]).map((e) => e.code),
|
||||
//locales: (locales.value as LocaleObject[]).map((e) => e.code),
|
||||
// 【一時対応】とりあえずビルドできるようにする
|
||||
locales: ['ja'],
|
||||
});
|
||||
|
||||
const route = useRoute();
|
||||
@ -38,6 +40,10 @@ const slugs = (route.params.slug as string[]).filter((v) => v !== '');
|
||||
const { data } = await useAsyncData(`blog-${locale.value}-${slugs.join('-')}`, () => queryContent(`/${locale.value}/docs/${slugs.join('/')}`).findOne());
|
||||
const { navigation } = await useAsyncData('navigation', () => fetchContentNavigation());
|
||||
|
||||
if (!data.value) {
|
||||
throw createError({ statusCode: 404, statusMessage: 'page not found' });
|
||||
}
|
||||
|
||||
route.meta.title = data.value?.title;
|
||||
</script>
|
||||
|
||||
|
@ -5,15 +5,12 @@ import { Readable } from 'stream';
|
||||
import { writeFileSync } from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
// サイトドメインを指定(最後スラッシュ不要)
|
||||
//const domain = useRuntimeConfig().public.baseUrl;
|
||||
const domain = "your-app.com";
|
||||
|
||||
export default async function genSitemap(nitro: Nitro) {
|
||||
if (!nitro._prerenderedRoutes) {
|
||||
return;
|
||||
}
|
||||
|
||||
const domain = nitro.options.runtimeConfig.public.baseUrl;
|
||||
const publicDir = nitro.options.output.publicDir;
|
||||
|
||||
const routes = nitro._prerenderedRoutes?.map((e) => e.fileName || null).filter((e, i, a) => e && a.indexOf(e) === i && e.endsWith("index.html")).map((e) => {
|
||||
|
Loading…
Reference in New Issue
Block a user