Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sidebar): new plugin sidebar #323

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ ni @nolebase/<integration-name> -D
To find out the integration name, there is a list of integrations below.

- [UnoCSS (for Obsidian)](https://github.com/nolebase/obsidian-plugin-unocss)
- [Auto Sidebar](./packages/vitepress-plugin-sidebar/README.md)
- [Bi-Directional Links (for `markdown-it`)](./packages/markdown-it-bi-directional-links/README.md)
- [Elements Transformation (for `markdown-it`)](./packages/markdown-it-element-transform/README.md)
- [Lazy loading blurred thumbnails (for `markdown-it`)](./packages/markdown-it-unlazy-img/README.md)
Expand Down
1 change: 1 addition & 0 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ ni @nolebase/<integration-name> -D
要找到集成的名称,下面是一个我们当前支持的集成列表:

- [UnoCSS (Obsidian 插件)](https://github.com/nolebase/obsidian-plugin-unocss)
- [自动生成侧边栏](./packages/vitepress-plugin-sidebar/README.md)
- [双向链接(`markdown-it` 插件)](./packages/markdown-it-bi-directional-links/README.md)
- [元素转换(`markdown-it` 插件)](./packages/markdown-it-element-transform/README.md)
- [懒加载模糊预览图(`markdown-it` 插件)](./packages/markdown-it-unlazy-img/README.md)
Expand Down
2 changes: 2 additions & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export const sidebars: Record<string, DefaultTheme.Sidebar> = {
{
text: 'VitePress Plugins',
items: [
{ text: 'Auto Sidebar', link: '/pages/en/integrations/vitepress-plugin-sidebar/' },
{ text: 'Enhanced Readabilities', link: '/pages/en/integrations/vitepress-plugin-enhanced-readabilities/' },
{
text: 'Inline Links Previewing',
Expand Down Expand Up @@ -180,6 +181,7 @@ export const sidebars: Record<string, DefaultTheme.Sidebar> = {
{
text: 'VitePress 插件',
items: [
{ text: '自动生成侧边栏', link: '/pages/zh-CN/integrations/vitepress-plugin-sidebar/' },
{ text: '阅读增强', link: '/pages/zh-CN/integrations/vitepress-plugin-enhanced-readabilities/' },
{
text: '行内链接预览',
Expand Down
7 changes: 7 additions & 0 deletions docs/pages/en/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ features:
---

<script setup>
import sidebarPackageJSON from '~/packages/vitepress-plugin-sidebar/package.json'
import biDirectionalLinksPackageJSON from '~/packages/markdown-it-bi-directional-links/package.json'
import elementTransform from '~/packages/markdown-it-element-transform/package.json'
import unlazyImg from '~/packages/markdown-it-unlazy-img/package.json'
Expand Down Expand Up @@ -71,6 +72,12 @@ Nólëbase Integrations project provides a variety of integrations, plugins, com
</template>
</IntegrationCard>

<IntegrationCard type="vitepress" title="Auto Sidebar" package="vitepress-plugin-sidebar">
<template v-slot:badge>
<Badge type="tip" :text="`v${sidebarPackageJSON.version}`" />
</template>
</IntegrationCard>

<IntegrationCard type="vitepress" title="Enhanced Readabilities" package="vitepress-plugin-enhanced-readabilities">
<template v-slot:badge>
<Badge type="tip" :text="`v${enhancedReadabilities.version}`" />
Expand Down
9 changes: 9 additions & 0 deletions docs/pages/en/integrations/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script setup>
import sidebarPackageJSON from '~/packages/vitepress-plugin-sidebar/package.json'
import biDirectionalLinksPackageJSON from '~/packages/markdown-it-bi-directional-links/package.json'
import elementTransform from '~/packages/markdown-it-element-transform/package.json'
import unlazyImg from '~/packages/markdown-it-unlazy-img/package.json'
Expand Down Expand Up @@ -42,6 +43,14 @@ Nólëbase Integrations project provides a variety of integrations, plugins, com

<br />

<IntegrationCard type="vitepress" title="Auto Sidebar" package="vitepress-plugin-sidebar">
<template v-slot:badge>
<Badge type="tip" :text="`v${sidebarPackageJSON.version}`" />
</template>
</IntegrationCard>

<br />

<IntegrationCard type="vitepress" title="Enhanced Readabilities" package="vitepress-plugin-enhanced-readabilities">
<template v-slot:badge>
<Badge type="tip" :text="`v${enhancedReadabilities.version}`" />
Expand Down
35 changes: 35 additions & 0 deletions docs/pages/en/integrations/vitepress-plugin-sidebar/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<script setup>
import packageJSON from '~/packages/vitepress-plugin-sidebar/package.json'
</script>

# Auto Sidebar <Badge type="warning" :text="`Beta v${packageJSON.version}`" />

::: warning 🚧 Constructing
Nice to meet you! But sorry, this page is still under construction. If you don’t find the information you are interested in, you can first find the content you are interested in in the navigation in the sidebar to start reading.
:::

We are still working on it, stay tuned!

## Installation

Install `@nolebase/vitepress-plugin-sidebar` to your project dependencies by running the following command:

::: code-group

```shell [@antfu/ni]
ni @nolebase/vitepress-plugin-sidebar -D
```

```shell [pnpm]
pnpm add @nolebase/vitepress-plugin-sidebar -D
```

```shell [npm]
npm install @nolebase/vitepress-plugin-sidebar -D
```

```shell [yarn]
yarn add @nolebase/vitepress-plugin-sidebar -D
```

:::
7 changes: 7 additions & 0 deletions docs/pages/zh-CN/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ features:
---

<script setup>
import sidebarPackageJSON from '~/packages/vitepress-plugin-sidebar/package.json'
import biDirectionalLinksPackageJSON from '~/packages/markdown-it-bi-directional-links/package.json'
import elementTransform from '~/packages/markdown-it-element-transform/package.json'
import unlazyImg from '~/packages/markdown-it-unlazy-img/package.json'
Expand Down Expand Up @@ -71,6 +72,12 @@ Nólëbase 集成项目提供多种不同的集成、插件、组件和库来方
</template>
</IntegrationCard>

<IntegrationCard type="vitepress" title="自动生成侧边栏" package="vitepress-plugin-sidebar">
<template v-slot:badge>
<Badge type="tip" :text="`v${sidebarPackageJSON.version}`" />
</template>
</IntegrationCard>

<IntegrationCard type="vitepress" title="阅读增强" package="vitepress-plugin-enhanced-readabilities">
<template v-slot:badge>
<Badge type="tip" :text="`v${enhancedReadabilities.version}`" />
Expand Down
9 changes: 9 additions & 0 deletions docs/pages/zh-CN/integrations/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script setup>
import sidebarPackageJSON from '~/packages/vitepress-plugin-sidebar/package.json'
import biDirectionalLinksPackageJSON from '~/packages/markdown-it-bi-directional-links/package.json'
import elementTransform from '~/packages/markdown-it-element-transform/package.json'
import unlazyImg from '~/packages/markdown-it-unlazy-img/package.json'
Expand Down Expand Up @@ -42,6 +43,14 @@ Nólëbase 集成项目提供多种不同的集成、插件、组件和库来方

<br />

<IntegrationCard type="vitepress" title="自动生成侧边栏" package="vitepress-plugin-sidebar">
<template v-slot:badge>
<Badge type="tip" :text="`v${sidebarPackageJSON.version}`" />
</template>
</IntegrationCard>

<br />

<IntegrationCard type="vitepress" title="阅读增强" package="vitepress-plugin-enhanced-readabilities">
<template v-slot:badge>
<Badge type="tip" :text="`v${enhancedReadabilities.version}`" />
Expand Down
36 changes: 36 additions & 0 deletions docs/pages/zh-CN/integrations/vitepress-plugin-sidebar/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<script setup>
import packageJSON from '~/packages/vitepress-plugin-sidebar/package.json'
</script>

# 自动生成侧边栏 <Badge type="warning" :text="`Beta 测试 ${packageJSON.version}`" />

::: warning 🚧 施工中
很高兴见到你!但很抱歉,这个页面还在施工中,如果没有找到你感兴趣的信息,你可以先在侧边栏的导航中寻找你感兴趣的内容来开始阅读
:::

内容施工中,敬请期待!

## 安装

通过运行以下命令将 `@nolebase/vitepress-plugin-sidebar` 安装到您的项目依赖项中:

::: code-group

```shell [@antfu/ni]
ni @nolebase/vitepress-plugin-sidebar -D
```

```shell [pnpm]
pnpm add @nolebase/vitepress-plugin-sidebar -D
```

```shell [npm]
npm install @nolebase/vitepress-plugin-sidebar -D
```

```shell [yarn]
yarn add @nolebase/vitepress-plugin-sidebar -D
```

:::

27 changes: 27 additions & 0 deletions packages/vitepress-plugin-sidebar/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# `@nolebase/vitepress-plugin-sidebar`

A vitepress plugin to generate sidebar for your site.

## Install

### Npm

```shell
npm i @nolebase/vitepress-plugin-sidebar -D
```

### Yarn

```shell
yarn add @nolebase/vitepress-plugin-sidebar -D
```

### Pnpm

```shell
pnpm add @nolebase/vitepress-plugin-sidebar -D
```

## Documentation

Please refer to [Sidebar](https://nolebase-integrations.ayaka.io/pages/en/integrations/vitepress-plugin-sidebar/) for more information.
57 changes: 57 additions & 0 deletions packages/vitepress-plugin-sidebar/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"name": "@nolebase/vitepress-plugin-sidebar",
"type": "module",
"version": "2.7.0",
"description": "A vitepress plugin to generate sidebar for your site.",
"author": {
"name": "Nólëbase",
"email": "[email protected]",
"url": "https://github.com/nolebase"
},
"license": "MIT",
"homepage": "https://nolebase-integrations.ayaka.io/pages/en/integrations/vitepress-plugin-sidebar/",
"repository": {
"type": "git",
"url": "https://github.com/nolebase/integrations.git",
"directory": "packages/vitepress-plugin-sidebar"
},
"keywords": [
"vitepress",
"nolebase",
"markdown",
"vitepress-plugin",
"nolebase-integration",
"sidebar"
],
"sideEffects": [
"**/*.css"
],
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
}
},
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"README.md",
"dist",
"package.json"
],
"scripts": {
"dev": "concurrently \"pnpm run stub\"",
"stub": "unbuild --stub",
"build": "unbuild",
"package:publish": "pnpm build && pnpm publish --access public --no-git-checks"
},
"dependencies": {
"fs-extra": "^11.2.0",
"glob": "^11.0.0"
},
"devDependencies": {
"@types/fs-extra": "^11.0.4"
}
}
3 changes: 3 additions & 0 deletions packages/vitepress-plugin-sidebar/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export {
calculateSidebar,
} from './sidebar'
Loading