Simplify docs layout logic

pull/8873/head
Puru Vijay 3 years ago
parent 98515a9a88
commit 5d1cb84839

@ -1,17 +1,15 @@
export const prerender = true;
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');
if (url.pathname === '/docs') {
return {
sections: url.pathname === '/docs' ? [] : get_docs_list(get_docs_data())
sections: []
};
}
const { get_docs_data, get_docs_list } = await import('$lib/server/docs/index.js');
return {
sections: []
sections: get_docs_list(get_docs_data())
};
}

Loading…
Cancel
Save