mirror of
https://github.com/HeyPuter/puter.git
synced 2025-12-21 12:59:52 -06:00
doc: make first sidebar items make sense
This commit is contained in:
@@ -133,8 +133,10 @@ const generate_sidebar = (documents) => {
|
||||
}
|
||||
|
||||
// README.md always goes first
|
||||
const isReadmeA = a.outputName.toLowerCase().includes('readme');
|
||||
const isReadmeB = b.outputName.toLowerCase().includes('readme');
|
||||
const isReadmeA = a.outputName.toLowerCase().includes('readme') ||
|
||||
a.outputName.toLowerCase().includes('home');
|
||||
const isReadmeB = b.outputName.toLowerCase().includes('readme') ||
|
||||
b.outputName.toLowerCase().includes('home');
|
||||
if (isReadmeA) return -1;
|
||||
if (isReadmeB) return 1;
|
||||
|
||||
@@ -147,6 +149,9 @@ const generate_sidebar = (documents) => {
|
||||
if ( document.outputName.split('-').slice(-1)[0].toLowerCase() === 'readme' ) {
|
||||
title = 'Index (README.md)';
|
||||
}
|
||||
if ( document.outputName.split('-').slice(-1)[0].toLowerCase() === 'home' ) {
|
||||
title = `Home`;
|
||||
}
|
||||
return `* [${title}](${document.outputName.replace('.md', '')})\n`;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user