fix(docs): miss use of base for resolving author data

This commit is contained in:
Neko Ayaka
2026-08-05 16:05:26 +08:00
parent 4421b5810b
commit 20d6158144
+6 -2
View File
@@ -7,7 +7,7 @@ import { tryCatch } from '@moeru/std'
import { usePreferredReducedMotion } from '@vueuse/core'
import { intlFormat } from 'date-fns'
import { AvatarFallback, AvatarImage, AvatarRoot } from 'reka-ui'
import { Content, useData, useRoute } from 'vitepress'
import { Content, useData, useRoute, withBase } from 'vitepress'
import { computed, onMounted, ref, toRefs, watch } from 'vue'
import { useI18n } from 'vue-i18n'
@@ -106,7 +106,11 @@ const publishedAt = computed(() => {
const authors = computed(() => {
const data = (authorsData as unknown as { data: Array<{ url: string, authors: Author[] }> }).data
return data.find(item => item.url === path.value)?.authors || []
const currentPath = normalizeDocumentPath(path.value)
return data.find(item =>
normalizeDocumentPath(withBase(item.url)) === currentPath,
)?.authors || []
})
// Title snapshot keyed by `path`: `frontmatter` updates before the article