feat: render home page via api to reduce js size

This commit is contained in:
DIYgod
2022-11-17 20:22:34 +00:00
parent cd41e61363
commit cd2fdaf3da
10 changed files with 25 additions and 19 deletions
+1 -4
View File
@@ -195,9 +195,6 @@ export async function getPagesBySite(
visibility?: PageVisibilityEnum | null
take?: number | null
cursor?: string | null
includeContent?: boolean
includeExcerpt?: boolean
render?: boolean
tags?: string[]
},
customUnidata?: Unidata,
@@ -284,7 +281,7 @@ export async function getPagesBySite(
pages.total = pages.total - ((input.take || 10) - pages.list.length)
pages?.list.map((page) => {
expandPage(page, input.render || false)
expandPage(page, true)
delete page.body
return page
})
+1 -1
View File
@@ -43,7 +43,7 @@ const expandSite = (site: Profile) => {
(a: any) => a.trait_type === "xlog_custom_domain",
)?.value || ""
site.name = site.name || site.username
site.description = renderPageContent(site.bio || "", true).contentHTML
site.description = site.bio
if (site.avatars) {
site.avatars = site.avatars.map((avatar) => toGateway(avatar))