docs: update docs

This commit is contained in:
pengzhanbo 2024-05-05 02:00:01 +08:00
parent 5addb31e91
commit 3876c2d908
8 changed files with 28 additions and 6 deletions

View File

@ -19,6 +19,11 @@ export default defineUserConfig({
})
```
::: note
示例 Fork 自 [@vuepress/plugin-seo](https://ecosystem.vuejs.press/zh/plugins/seo/),
遵循 [MIT](https://github.com/vuepress/ecosystem/blob/main/LICENSE) 许可证。
:::
## 指南
主题会通过向网站 `<head>` 注入标签,让你的网站完全支持 [开放内容协议 OGP](https://ogp.me/)

View File

@ -58,6 +58,11 @@ export default defineUserConfig({
- 面向公众: Waline
:::
::: note
示例 Fork 自 [@vuepress/plugin-comment](https://ecosystem.vuejs.press/zh/plugins/comment/),
遵循 [MIT](https://github.com/vuepress/ecosystem/blob/main/LICENSE) 许可证。
:::
## Giscus
Giscus 是一个基于 GitHub Discussion 的评论系统,启用简便。

View File

@ -3,7 +3,7 @@
"type": "module",
"private": true,
"scripts": {
"docs:build": "vuepress build --clean-cache",
"docs:build": "vuepress build --clean-cache --clean-temp",
"docs:clean": "rimraf .vuepress/.temp .vuepress/.cache .vuepress/dist",
"docs:dev": "vuepress dev",
"docs:serve": "anywhere -s -h localhost -d .vuepress/dist"

View File

@ -41,7 +41,7 @@ export function caniusePlugin({
}
pluginObj.extendsMarkdown = (md) => {
md.use(container, type, { validate, render })
md.use(container as any, type, { validate, render })
}
return pluginObj

View File

@ -47,6 +47,7 @@
},
"dependencies": {
"@iconify/utils": "^2.1.23",
"@vuepress/helper": "2.0.0-rc.24",
"@vueuse/core": "^10.9.0",
"local-pkg": "^0.5.0",
"markdown-it-container": "^4.0.0",

View File

@ -1,5 +1,6 @@
import type { Plugin } from 'vuepress/core'
import type MarkdownIt from 'markdown-it'
import { addViteOptimizeDepsInclude } from '@vuepress/helper'
import type { CanIUseOptions, MarkdownPowerPluginOptions } from '../shared/index.js'
import { caniusePlugin, legacyCaniuse } from './features/caniuse.js'
import { pdfPlugin } from './features/pdf.js'
@ -30,6 +31,14 @@ export function markdownPowerPlugin(options: MarkdownPowerPluginOptions = {}): P
onInitialized: async () => await initIcon(),
extendsBundlerOptions(bundlerOptions) {
options.repl && addViteOptimizeDepsInclude(
bundlerOptions,
app,
['shiki/core', 'shiki/wasm'],
)
},
extendsMarkdown: async (md: MarkdownIt, app) => {
if (options.caniuse) {
const caniuse = options.caniuse === true ? {} : options.caniuse

View File

@ -14,17 +14,20 @@ export function searchPlugin({
}: SearchPluginOptions = {}): Plugin {
return app => ({
name: '@vuepress-plume/plugin-search',
clientConfigFile: path.resolve(__dirname, '../client/config.js'),
define: {
__SEARCH_LOCALES__: locales,
__SEARCH_OPTIONS__: searchOptions,
},
extendsBundlerOptions(bundlerOptions) {
addViteOptimizeDepsInclude(bundlerOptions, app, ['mark.js/src/vanilla.js', '@vueuse/integrations/useFocusTrap', 'minisearch'])
},
onPrepared: async (app) => {
await prepareSearchIndex({ app, isSearchable, searchOptions })
},
onPrepared: app => prepareSearchIndex({ app, isSearchable, searchOptions }),
onWatched: async (app, watchers) => {
const searchIndexWatcher = chokidar.watch('pages/**/*.js', {
cwd: app.dir.temp(),

View File

@ -22,7 +22,6 @@ import { sitemapPlugin } from '@vuepress/plugin-sitemap'
import { contentUpdatePlugin } from '@vuepress-plume/plugin-content-update'
import { searchPlugin } from '@vuepress-plume/plugin-search'
import { markdownPowerPlugin } from 'vuepress-plugin-md-power'
import { isObject } from '@pengzhanbo/utils'
import type {
PlumeThemeEncrypt,
PlumeThemeLocaleOptions,