fix: encodeURIComponent to page slug

This commit is contained in:
DIYgod 2022-10-14 21:32:45 +01:00
parent 6520ba342a
commit ed27a48db4
No known key found for this signature in database
GPG Key ID: D159328F47A80DCA
1 changed files with 5 additions and 4 deletions

View File

@ -119,11 +119,12 @@ const expandPage = (page: Note, render: boolean) => {
}
page.cover = rendered.cover
}
page.slug =
page.slug = encodeURIComponent(
page.attributes?.find((a) => a.trait_type === "xlog_slug")?.value ||
page.metadata?.raw?._xlog_slug ||
page.metadata?.raw?._crosslog_slug ||
""
page.metadata?.raw?._xlog_slug ||
page.metadata?.raw?._crosslog_slug ||
"",
)
return page
}