mirror of
https://github.com/lbr77/blog-astro.git
synced 2026-04-10 09:39:11 +00:00
fix
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user