Skip to content

Commit

Permalink
docs: improve plugin and theme guide
Browse files Browse the repository at this point in the history
  • Loading branch information
meteorlxy committed Dec 29, 2023
1 parent 8397875 commit d71cf2d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
12 changes: 9 additions & 3 deletions docs/guide/plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

With the help of [Plugin API](../reference/plugin-api.md), VuePress plugin can provide different features for you.

## Community Plugin
## Official Plugin

Community users have created lots of plugins and published them to [NPM](https://www.npmjs.com/search?q=keywords:vuepress-plugin). VuePress team also maintains some official plugins under the [@vuepress](https://www.npmjs.com/search?q=%40vuepress%20keywords%3Aplugin) scope. You should check the plugin's own documentation for detailed guide.
VuePress team provides some official plugins.

In general, you need to import the plugin and use it in your config file via the [plugins](../reference/config.md#plugins) option. For example, use the [@vuepress/plugin-google-analytics](../reference/plugin/google-analytics.md) to integrate Google Analytics:
You need to import and use them in your config file via the [plugins](../reference/config.md#plugins) option. For example, use the [@vuepress/plugin-google-analytics](../reference/plugin/google-analytics.md) to integrate Google Analytics:

```ts
import { googleAnalyticsPlugin } from '@vuepress/plugin-google-analytics'
Expand All @@ -26,6 +26,12 @@ Most plugins can only be used once. If the same plugin is used multiple times, o
However, some plugins can be used multiple times (e.g. [@vuepress/plugin-container](../reference/plugin/container.md)), and you should check the documentation of the plugin itself for detailed guide.
:::

## Community Plugin

Community users have created lots of plugins and published them to [NPM](https://www.npmjs.com/search?q=keywords:vuepress-plugin). You should check the plugin's own documentation for detailed guide.

You can explore more plugins in [Awesome VuePress](https://github.com/vuepress/awesome-vuepress) or [VuePress Marketplace](https://marketplace.vuejs.press/).

## Local Plugin

If you want to use your own plugin but don't want to publish it, you can create a local plugin.
Expand Down
2 changes: 2 additions & 0 deletions docs/guide/theme.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ However, you might think it is not good enough. Or, you want to build a differen

Community users have created lots of theme and published them to [NPM](https://www.npmjs.com/search?q=keywords:vuepress-theme). You should check the theme's own documentation for detailed guide.

You can explore more themes in [Awesome VuePress](https://github.com/vuepress/awesome-vuepress) or [VuePress Marketplace](https://marketplace.vuejs.press/).

## Local Theme

If you want to use your own custom theme but don't want to publish it, you can create a local theme. Refer to [Advanced > Writing a Theme](../advanced/theme.md) for how to write your own theme.
12 changes: 9 additions & 3 deletions docs/zh/guide/plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

借助于 [插件 API](../reference/plugin-api.md) , VuePress 插件可以为你提供各种不同的功能。

## 社区插件
## 官方插件

社区用户创建了很多插件,并将它们发布到了 [NPM](https://www.npmjs.com/search?q=keywords:vuepress-plugin) 上。 VuePress 团队也在 [@vuepress](https://www.npmjs.com/search?q=%40vuepress%20keywords%3Aplugin) Scope 下维护了一些官方插件。查看插件本身的文档可以获取更详细的指引
VuePress 团队提供了一些官方插件

一般而言,你需要导入插件并通过配置文件的 [plugins](../reference/config.md#plugins) 配置项来使用它。举例来说,你可以使用 [@vuepress/plugin-google-analytics](../reference/plugin/google-analytics.md) 来使用 Google Analytics :
你需要在你的配置文件中通过 [plugins](../reference/config.md#plugins) 配置项来使用它们。举例来说,你可以使用 [@vuepress/plugin-google-analytics](../reference/plugin/google-analytics.md) 来使用 Google Analytics :

```ts
import { googleAnalyticsPlugin } from '@vuepress/plugin-google-analytics'
Expand All @@ -26,6 +26,12 @@ export default {
然而,部分插件是可以被多次使用的(例如 [@vuepress/plugin-container](../reference/plugin/container.md)),你应该查看插件本身的文档来获取详细指引。
:::

## 社区插件

社区用户创建了很多插件,并将它们发布到了 [NPM](https://www.npmjs.com/search?q=keywords:vuepress-plugin) 上。 查看插件本身的文档可以获取更详细的指引。

你可以在 [Awesome VuePress](https://github.com/vuepress/awesome-vuepress) 或者 [VuePress Marketplace](https://marketplace.vuejs.press/) 中探索更多插件。

## 本地插件

如果你想要使用自己的插件,但是又不想发布它,你可以创建一个本地插件。
Expand Down
2 changes: 2 additions & 0 deletions docs/zh/guide/theme.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ export default defineUserConfig({

社区用户创建了很多主题,并将它们发布到了 [NPM](https://www.npmjs.com/search?q=keywords:vuepress-theme) 上。查看主题本身的文档可以获取更详细的指引。

你可以在 [Awesome VuePress](https://github.com/vuepress/awesome-vuepress) 或者 [VuePress Marketplace](https://marketplace.vuejs.press/) 中探索更多主题。

## 本地主题

如果你想要使用自己的自定义主题,但是又不想发布它,你可以创建一个本地主题。前往 [深入 > 开发主题](../advanced/theme.md) 学习如何开发你自己的主题。

0 comments on commit d71cf2d

Please sign in to comment.