Jelajahi Sumber

doc: make first sidebar items make sense

KernelDeimos 2 bulan lalu
induk
melakukan
eda376b6cc
2 mengubah file dengan 9 tambahan dan 12 penghapusan
  1. 2 10
      src/backend/doc/features/batch-and-symlinks.md
  2. 7 2
      tools/genwiki/main.js

+ 2 - 10
doc/scratch.md → src/backend/doc/features/batch-and-symlinks.md

@@ -1,14 +1,6 @@
-# Documentation Scratchpad
-
-## 2024-10-08
-
-This is place where any documentation can be written, and this documentation
-may later be moved or reformatted.
-
-I added this file because I noticed sometimes I don't write documentation
-simply because I don't yet know the best place to put the documentation,
-which in retrospect seems incredibly silly so instead this file should exist.
+# Batch and Symlinks
 
+2024-10-08
 
 ### Batch and Symlinks
 

+ 7 - 2
tools/genwiki/main.js

@@ -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`;
     };