Skip to content

Commit

Permalink
docs: add documentation for generateSidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
Kiameow committed Jul 29, 2024
1 parent 6636693 commit a4a7cc7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .vitepress/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,18 @@ export function generateSidebarBasic(dir, excludeDir = [], maxDepth, currentDept
return sidebar.filter(Boolean);
}

/**
* Generates a sidebar configuration for VitePress.
*
* @param {string} dir - The directory to generate the sidebar from.
* @param {Object} [options] - Optional parameters.
* @param {string[]} [options.excludeDir=['static']] - Directories to exclude from the sidebar.
* @param {string} [options.previousLevel='/'] - Link to the previous level.
* @param {string} [options.previousLevelDescription='返回上一层'] - Description for the previous level link.
* @param {string} [options.topLevelName] - Name for the top level of the sidebar.
* @param {number} [options.maxDepth=5] - Maximum depth of directories to include.
* @returns {Object[]} Sidebar configuration array.
*/
export function generateSidebar(
dir,
{
Expand Down

0 comments on commit a4a7cc7

Please sign in to comment.