Enables docs to be in the root of the site instead of nested in any subfolder (/docs in the example). Example of where this would be useful (to keep existing URLs).
The layout.js page would change to return an empty string for the root path:
Other references to /docs would be removed, page.js for example:
export function load() {
throw redirect(307, '/getting-started/introduction');
}
I used 'index' to represent the root when the sidebar is requested which was also used for the root meta request - it's possible this could interfere with someone having a docs folder called /index so might benefit from changing to some special character (such as ~). Another alternative might be to make the route param optional (/[[dir]].sidebar/+server.js) instead.
Enables docs to be in the root of the site instead of nested in any subfolder (
/docs
in the example). Example of where this would be useful (to keep existing URLs).The layout.js page would change to return an empty string for the root path:
Other references to
/docs
would be removed, page.js for example:I used 'index' to represent the root when the sidebar is requested which was also used for the root meta request - it's possible this could interfere with someone having a docs folder called
/index
so might benefit from changing to some special character (such as~
). Another alternative might be to make the route param optional (/[[dir]].sidebar/+server.js
) instead.