@ulu/vitepress-auto-menus
Advanced tools
Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "@ulu/vitepress-auto-menus", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Use to automatically populate the config with the page links (default theme nav, sidebar). Supports configuration, page weight for ordering. Page tree can be used independently for custom implementations or you can use the helper function toDefaultTheme to convert.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,6 +0,6 @@ | ||
# Vuepress Page Tree | ||
# Vitepress Auto Menus | ||
This plugin creates a page tree, used to automatically populate navigation in default theme. You pass it the source directory (docs directory), and it gives you back a tree. It then provides a function to map the tree to the default theme (what the config needs). | ||
Children are mapped to the sidebar, if you want different menu structure for the navbar or sidebar, create it using from the output of `createTree`. | ||
Children are mapped to the sidebar, if you want different menu structure for the nav or sidebar, create it using from the output of `createTree`. | ||
@@ -10,24 +10,15 @@ ## Usage | ||
```js | ||
import { defineConfig } from 'vitepress'; | ||
import { resolve } from "path"; | ||
import { createTree, toDefaultTheme } from "@ulu/vitepress-auto-menus"; | ||
import { defineUserConfig } from "vuepress"; | ||
import { dirname, resolve } from "path"; | ||
import { fileURLToPath } from "url"; | ||
import { defaultTheme } from "@vuepress/theme-default"; | ||
import { createTree, toDefaultTheme } from "@ulu/vuepress-page-tree"; | ||
const pages = createTree({ source: resolve(__dirname, "../") }); | ||
const __dirname = dirname(fileURLToPath(import.meta.url)); | ||
const tree = createTree({ | ||
source: resolve(__dirname, "../") | ||
}); | ||
export default defineUserConfig({ | ||
lang: "en-US", | ||
title: "Test", | ||
description: "Test", | ||
theme: defaultTheme({ | ||
...toDefaultTheme(tree) | ||
}) | ||
}); | ||
export default defineConfig({ | ||
title: "Test Plugin", | ||
description: "Vitepress site for testing plugin", | ||
themeConfig: { | ||
...toDefaultTheme(pages), | ||
} | ||
}) | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7438
23