mirror of https://github.com/sveltejs/svelte
parent
7934a7f4d2
commit
e9d7b9dd57
@ -1,9 +1,17 @@
|
||||
import { get_docs_data, get_docs_list } from '$lib/server/docs/index.js';
|
||||
|
||||
export const prerender = true;
|
||||
|
||||
export function load({ url }) {
|
||||
export async function load({ url }) {
|
||||
const is_docs_index = url.pathname === '/docs';
|
||||
|
||||
if (!is_docs_index) {
|
||||
const { get_docs_data, get_docs_list } = await import('$lib/server/docs/index.js');
|
||||
|
||||
return {
|
||||
sections: url.pathname === '/docs' ? [] : get_docs_list(get_docs_data())
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
sections: []
|
||||
};
|
||||
}
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
// This page now exists solely for redirect, prerendering triggers the `handleMissingID`
|
||||
export const prerender = false;
|
||||
export const prerender = true;
|
||||
|
||||
Loading…
Reference in new issue