rework/lightweight #12
@ -25,8 +25,8 @@ export default {
|
|||||||
class: "flex min-h-full bg-white",
|
class: "flex min-h-full bg-white",
|
||||||
},
|
},
|
||||||
|
|
||||||
// prerender: true,
|
prerender: true,
|
||||||
// prefetchStaticAssets: "hover",
|
prefetchStaticAssets: "hover",
|
||||||
|
|
||||||
extends: [vikeSolid],
|
extends: [vikeSolid],
|
||||||
} satisfies Config;
|
} satisfies Config;
|
||||||
|
|||||||
@ -21,14 +21,13 @@ export async function data(pageContext: PageContext) {
|
|||||||
description: frontmatter?.description,
|
description: frontmatter?.description,
|
||||||
});
|
});
|
||||||
|
|
||||||
let doc: SectionCache | undefined;
|
let cachePathname = urlParsed.pathname.replace(/\/$/, "").replace(/^\//, "");
|
||||||
|
if (cachePathname === "") {
|
||||||
if (urlParsed.pathname === "/") {
|
cachePathname = "index";
|
||||||
doc = docCache.get("index");
|
|
||||||
} else {
|
|
||||||
doc = docCache.get(urlParsed.pathname);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const doc = docCache.get(cachePathname);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
sections: doc?.sections || [],
|
sections: doc?.sections || [],
|
||||||
frontmatter,
|
frontmatter,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user