This commit is contained in:
2025-11-28 17:20:08 +08:00
parent 0b0650f374
commit f1d413afae
6 changed files with 49 additions and 403 deletions

View File

@@ -38,25 +38,18 @@ export async function getStaticPaths() {
}))
}
const post = Astro.props
const currentPostId = Astro.params.id
const isRemotePost = post.body === ''
let Content: any = null
let headings
let remoteContent = null
if (isRemotePost) {
const remote = await fetchRemotePostContent(currentPostId)
remoteContent = remote ? renderRemoteBlockMap(remote.blockMap, remote.post.id) : null
headings = remoteContent?.headings ?? []
} else {
const rendered = await render(post)
Content = rendered.Content
headings = rendered.headings
}
const authors = await parseAuthors(post.data.authors ?? [])
const remote = await fetchRemotePostContent(currentPostId)
remoteContent = remote ? renderRemoteBlockMap(remote.blockMap, remote.post.id) : null
headings = remoteContent?.headings ?? []
const post = remote?.post
const authors = await parseAuthors(post.authors ?? [])
const isCurrentSubpost = isSubpost(currentPostId)
const navigation = await getAdjacentPosts(currentPostId)