|
|
@ -20,9 +20,12 @@ export async function renderPage(
|
|
|
|
pageToHashMap: Record<string, string>,
|
|
|
|
pageToHashMap: Record<string, string>,
|
|
|
|
hashMapString: string
|
|
|
|
hashMapString: string
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
const { createApp } = await import(
|
|
|
|
const entryPath = [
|
|
|
|
pathToFileURL(path.join(config.tempDir, `app.js`)).toString()
|
|
|
|
path.join(config.tempDir, `app.mjs`),
|
|
|
|
)
|
|
|
|
path.join(config.tempDir, `app.js`)
|
|
|
|
|
|
|
|
].find((i) => fs.existsSync(i))!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { createApp } = await import(pathToFileURL(entryPath).toString())
|
|
|
|
const { app, router } = createApp()
|
|
|
|
const { app, router } = createApp()
|
|
|
|
const routePath = `/${page.replace(/\.md$/, '')}`
|
|
|
|
const routePath = `/${page.replace(/\.md$/, '')}`
|
|
|
|
const siteData = resolveSiteDataByRoute(config.site, routePath)
|
|
|
|
const siteData = resolveSiteDataByRoute(config.site, routePath)
|
|
|
|