mirror of
https://iceshrimp.dev/Crimekillz/jointrashposs.git
synced 2024-11-21 16:33:48 +01:00
fix proseA
This commit is contained in:
parent
ce84e471b8
commit
2ee78f1faf
@ -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があるので1つくり下げる)
|
||||
if (isRelative(realHref.value)) {
|
||||
if (isRelative(realHref.value) && route.meta.__isDocsIndexPage !== true) {
|
||||
realHref.value = joinURL('../', realHref.value.replace(/^\.\//, ''));
|
||||
}
|
||||
|
||||
|
@ -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
3
types/router.d.ts
vendored
@ -17,5 +17,8 @@ declare module 'vue-router' {
|
||||
};
|
||||
customClass?: string;
|
||||
};
|
||||
|
||||
/** @private */
|
||||
__isDocsIndexPage?: boolean;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user