Skip to content

Commit

Permalink
docs: separate docs with category
Browse files Browse the repository at this point in the history
  • Loading branch information
jooy2 committed May 29, 2024
1 parent 0c4e266 commit c56ee52
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 17 deletions.
5 changes: 3 additions & 2 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export default defineConfig({
sidebar: generateSidebar({
debugPrint: true,
documentRootPath: 'docs',
manualSortFileNameByPriority: ['guide', 'advanced-usage'],
collapsed: false,
capitalizeFirst: true,
useTitleFromFileHeading: true,
Expand All @@ -35,11 +36,11 @@ export default defineConfig({
nav: [
{
text: 'Installation',
link: 'getting-started'
link: '/guide/getting-started'
},
{
text: 'API Reference',
link: 'api'
link: '/guide/api'
},
{
text: 'Changelog',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
order: 3
---

# Multiple Sidebars How-to

To learn more about multiple sidebars, see the articles below:
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions docs/getting-started.md → docs/guide/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This page walks you through the installation and use of the VitePress Sidebar mo

First, you may need to pre-configure **[VitePress](https://vitepress.dev)** before using this module.

We recommend using **Node.js 18.x** or higher. The **VitePress Sidebar** is written in `ESM`. To use it in `CommonJS`, [see instructions here](/troubleshooting#err-require-esm).
We recommend using **Node.js 18.x** or higher. The **VitePress Sidebar** is written in `ESM`. To use it in `CommonJS`, [see instructions here](/troubleshooting/err-require-esm.md).

You will need to install the module using [NPM](https://www.npmjs.com/package/vitepress-sidebar) or any other Node module package manager. The package should be installed in `devDependencies` as it is only used in the developer environment. Use the command below:

Expand Down Expand Up @@ -71,7 +71,7 @@ Use the `generateSidebar` method in the `themeConfig.sidebar` property of the `.

To test how this will output, try building VitePress with the `debugPrint` option set to `true`. You should see the output in the console.

For more information about the configuration of `generateSidebar`, see **[API](/api)** section below.
For more information about the configuration of `generateSidebar`, see **[API](/guide/api)** section below.

## Code Example

Expand Down
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ hero:
actions:
- theme: brand
text: Getting Started
link: /getting-started
link: /guide/getting-started
- theme: alt
text: API
link: /api
link: /guide/api
- theme: alt
text: GitHub
link: https://github.com/jooy2/vitepress-sidebar
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
---
order: 4
---

# Troubleshooting

## `ERR_REQUIRE_ESM`
# `ERR_REQUIRE_ESM`

`vitepress-sidebar` is an **ESM** module. If your project is using **CJS**, you will need to convert it to an **ESM** module.

Expand Down

0 comments on commit c56ee52

Please sign in to comment.