fix proseA

This commit is contained in:
kakkokari-gtyih 2023-12-30 13:29:37 +09:00
parent ce84e471b8
commit 2ee78f1faf
3 changed files with 9 additions and 1 deletions

View File

@ -7,6 +7,7 @@ import { isLocalPath, sanitizeInternalPath } from '@/assets/js/misc';
const runtimeConfig = useRuntimeConfig();
const rootDomain = parseURL(runtimeConfig.public.baseUrl);
const { resolve } = useRouter();
const route = useRoute();
const localePath = useGLocalePath();
const props = defineProps({
@ -28,7 +29,7 @@ const url = parseURL(realHref.value);
if (isLocalPath(realHref.value)) {
// trailing slash
if (isRelative(realHref.value)) {
if (isRelative(realHref.value) && route.meta.__isDocsIndexPage !== true) {
realHref.value = joinURL('../', realHref.value.replace(/^\.\//, ''));
}

View File

@ -70,6 +70,10 @@ if (!data.value) {
throw createError({ statusCode: 404, statusMessage: 'page not found', fatal: true });
}
if (data.value._path && /index\.[a-z]+$/.test(data.value._path)) {
route.meta.__isDocsIndexPage = true;
}
route.meta.title = data.value?.title;
if (data.value.description) {
route.meta.description = data.value.description;

3
types/router.d.ts vendored
View File

@ -17,5 +17,8 @@ declare module 'vue-router' {
};
customClass?: string;
};
/** @private */
__isDocsIndexPage?: boolean;
}
}