chore: update vuepress dependencies
更新 vuepress 相关依赖至 2.0.0.beta.41,暂时下线hope相关插件 BREAKING CHANGE: 跟随vuepress@2.0.0.beta.41的重大变更
This commit is contained in:
parent
781670a066
commit
e04e2a1973
@ -1,14 +1,14 @@
|
|||||||
import * as path from 'path'
|
import * as path from 'path'
|
||||||
import type { PlumeThemeOptions } from '@vuepress-plume/vuepress-theme-plume'
|
import { themePlume } from '@vuepress-plume/vuepress-theme-plume'
|
||||||
import { defineUserConfig } from '@vuepress/cli'
|
import { defineUserConfig } from '@vuepress/cli'
|
||||||
|
|
||||||
export default defineUserConfig<PlumeThemeOptions>({
|
export default defineUserConfig({
|
||||||
|
base: '/',
|
||||||
lang: 'zh',
|
lang: 'zh',
|
||||||
title: 'Plume Theme',
|
title: 'Plume Theme',
|
||||||
description: '',
|
description: '',
|
||||||
public: path.resolve(__dirname, 'public'),
|
public: path.resolve(__dirname, 'public'),
|
||||||
theme: '@vuepress-plume/vuepress-theme-plume',
|
theme: themePlume({
|
||||||
themeConfig: {
|
|
||||||
logo: 'https://pengzhanbo.cn/g.gif',
|
logo: 'https://pengzhanbo.cn/g.gif',
|
||||||
hostname: 'https://pengzhanbo.cn',
|
hostname: 'https://pengzhanbo.cn',
|
||||||
avatar: {
|
avatar: {
|
||||||
@ -101,5 +101,5 @@ export default defineUserConfig<PlumeThemeOptions>({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
}),
|
||||||
})
|
})
|
||||||
|
|||||||
@ -19,7 +19,7 @@
|
|||||||
"docs:webpack-build": "vuepress-webpack build docs",
|
"docs:webpack-build": "vuepress-webpack build docs",
|
||||||
"docs:webpack-serve": "vuepress-webpack dev docs",
|
"docs:webpack-serve": "vuepress-webpack dev docs",
|
||||||
"lerna": "lerna clean && lerna bootstrap",
|
"lerna": "lerna clean && lerna bootstrap",
|
||||||
"lerna:publish": "node scripts/release/index.mjs --input-type module",
|
"lerna:publish": "node scripts/release/index.mjs",
|
||||||
"lint": "eslint --ext .js,.ts,.vue .",
|
"lint": "eslint --ext .js,.ts,.vue .",
|
||||||
"package:clean": "lerna run clean",
|
"package:clean": "lerna run clean",
|
||||||
"package:update": "node scripts/dependencies.js",
|
"package:update": "node scripts/dependencies.js",
|
||||||
@ -51,7 +51,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@commitlint/cli": "^16.2.3",
|
"@commitlint/cli": "^16.2.3",
|
||||||
"@commitlint/config-conventional": "^16.2.1",
|
"@commitlint/config-conventional": "^16.2.1",
|
||||||
"@vuepress/cli": "^2.0.0-beta.38",
|
"@vuepress/cli": "^2.0.0-beta.41",
|
||||||
"commitizen": "^4.2.4",
|
"commitizen": "^4.2.4",
|
||||||
"concurrently": "^7.0.0",
|
"concurrently": "^7.0.0",
|
||||||
"cpx2": "^4.2.0",
|
"cpx2": "^4.2.0",
|
||||||
@ -67,8 +67,8 @@
|
|||||||
"prettier-config-vuepress": "^1.4.0",
|
"prettier-config-vuepress": "^1.4.0",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"typescript": "^4.6.3",
|
"typescript": "^4.6.3",
|
||||||
"vuepress-vite": "^2.0.0-beta.39",
|
"vuepress-vite": "^2.0.0-beta.41",
|
||||||
"vuepress-webpack": "^2.0.0-beta.38",
|
"vuepress-webpack": "^2.0.0-beta.41",
|
||||||
"webpack-env": "^0.8.0"
|
"webpack-env": "^0.8.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,36 +2,34 @@
|
|||||||
"name": "@vuepress-plume/vuepress-plugin-caniuse",
|
"name": "@vuepress-plume/vuepress-plugin-caniuse",
|
||||||
"version": "1.0.0-beta.8",
|
"version": "1.0.0-beta.8",
|
||||||
"description": "The Plugin for VuePres 2, Support Can-I-Use feature",
|
"description": "The Plugin for VuePres 2, Support Can-I-Use feature",
|
||||||
"author": "pengzhanbo <volodymyr@foxmail.com>",
|
|
||||||
"homepage": "https://github.com/pengzhanbo/vuepress-theme-plume#readme",
|
"homepage": "https://github.com/pengzhanbo/vuepress-theme-plume#readme",
|
||||||
"license": "MIT",
|
"bugs": {
|
||||||
"main": "lib/node/index.js",
|
"url": "https://github.com/pengzhanbo/vuepress-theme-plume/issues"
|
||||||
"files": [
|
},
|
||||||
"lib"
|
|
||||||
],
|
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/pengzhanbo/vuepress-theme-plume.git"
|
"url": "git+https://github.com/pengzhanbo/vuepress-theme-plume.git"
|
||||||
},
|
},
|
||||||
"bugs": {
|
"license": "MIT",
|
||||||
"url": "https://github.com/pengzhanbo/vuepress-theme-plume/issues"
|
"author": "pengzhanbo <volodymyr@foxmail.com>",
|
||||||
},
|
"main": "lib/node/index.js",
|
||||||
|
"files": [
|
||||||
|
"lib"
|
||||||
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"ts": "tsc -b tsconfig.build.json",
|
"build": "yarn clean && yarn ts",
|
||||||
"ts:watch": "tsc -b tsconfig.build.json --watch",
|
|
||||||
"clean": "rimraf lib *.tsbuildinfo",
|
"clean": "rimraf lib *.tsbuildinfo",
|
||||||
"dev": "yarn ts:watch",
|
"dev": "yarn ts:watch",
|
||||||
"build": "yarn clean && yarn ts"
|
"ts": "tsc -b tsconfig.build.json",
|
||||||
|
"ts:watch": "tsc -b tsconfig.build.json --watch"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@vuepress/client": "^2.0.0-beta.38",
|
"@vuepress/cli": "^2.0.0-beta.41",
|
||||||
"@vuepress/core": "^2.0.0-beta.38",
|
"@vuepress/client": "^2.0.0-beta.41",
|
||||||
"@vuepress/utils": "^2.0.0-beta.38",
|
"@vuepress/core": "^2.0.0-beta.41",
|
||||||
|
"@vuepress/utils": "^2.0.0-beta.41",
|
||||||
"markdown-it-container": "^3.0.0"
|
"markdown-it-container": "^3.0.0"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
|
||||||
"vuepress": "^2.0.0-beta.38"
|
|
||||||
},
|
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"access": "public"
|
"access": "public"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { plugin } from './plugin'
|
import { caniusePlugin } from './plugin'
|
||||||
|
|
||||||
export * from './plugin'
|
export * from './plugin'
|
||||||
export * from '../shared'
|
export * from '../shared'
|
||||||
|
|
||||||
export default plugin
|
export default caniusePlugin
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import type { Plugin, PluginObject } from '@vuepress/core'
|
import type { PluginObject } from '@vuepress/core'
|
||||||
import { path } from '@vuepress/utils'
|
import { path } from '@vuepress/utils'
|
||||||
import * as container from 'markdown-it-container'
|
import * as container from 'markdown-it-container'
|
||||||
import type * as Token from 'markdown-it/lib/token'
|
import type * as Token from 'markdown-it/lib/token'
|
||||||
@ -8,7 +8,9 @@ import { resolveCanIUse } from './resolveCanIUse'
|
|||||||
const modeMap: CanIUseMode[] = ['image', 'embed']
|
const modeMap: CanIUseMode[] = ['image', 'embed']
|
||||||
const isMode = (mode: CanIUseMode): boolean => modeMap.includes(mode)
|
const isMode = (mode: CanIUseMode): boolean => modeMap.includes(mode)
|
||||||
|
|
||||||
export const plugin: Plugin = ({ mode = modeMap[0] }: CanIUsePluginOptions) => {
|
export const caniusePlugin = ({
|
||||||
|
mode = modeMap[0],
|
||||||
|
}: CanIUsePluginOptions): PluginObject => {
|
||||||
mode = isMode(mode) ? mode : modeMap[0]
|
mode = isMode(mode) ? mode : modeMap[0]
|
||||||
const type = 'caniuse'
|
const type = 'caniuse'
|
||||||
const validateReg = new RegExp(`^${type}\\s+(.*)$`)
|
const validateReg = new RegExp(`^${type}\\s+(.*)$`)
|
||||||
|
|||||||
@ -29,21 +29,21 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/lodash.merge": "^4.6.6",
|
"@types/lodash.merge": "^4.6.6",
|
||||||
"@vuepress-plume/vuepress-plugin-caniuse": "1.0.0-beta.8",
|
"@vuepress-plume/vuepress-plugin-caniuse": "1.0.0-beta.8",
|
||||||
"@vuepress/client": "^2.0.0-beta.38",
|
"@vuepress/client": "^2.0.0-beta.41",
|
||||||
"@vuepress/core": "^2.0.0-beta.38",
|
"@vuepress/core": "^2.0.0-beta.41",
|
||||||
"@vuepress/plugin-active-header-links": "^2.0.0-beta.38",
|
"@vuepress/plugin-active-header-links": "^2.0.0-beta.41",
|
||||||
"@vuepress/plugin-container": "^2.0.0-beta.38",
|
"@vuepress/plugin-container": "^2.0.0-beta.41",
|
||||||
"@vuepress/plugin-docsearch": "^2.0.0-beta.38",
|
"@vuepress/plugin-docsearch": "^2.0.0-beta.41",
|
||||||
"@vuepress/plugin-external-link-icon": "^2.0.0-beta.38",
|
"@vuepress/plugin-external-link-icon": "^2.0.0-beta.41",
|
||||||
"@vuepress/plugin-medium-zoom": "^2.0.0-beta.38",
|
"@vuepress/plugin-medium-zoom": "^2.0.0-beta.41",
|
||||||
"@vuepress/plugin-nprogress": "^2.0.0-beta.38",
|
"@vuepress/plugin-nprogress": "^2.0.0-beta.41",
|
||||||
"@vuepress/plugin-palette": "^2.0.0-beta.38",
|
"@vuepress/plugin-palette": "^2.0.0-beta.41",
|
||||||
"@vuepress/plugin-prismjs": "^2.0.0-beta.38",
|
"@vuepress/plugin-prismjs": "^2.0.0-beta.41",
|
||||||
"@vuepress/plugin-search": "^2.0.0-beta.38",
|
"@vuepress/plugin-search": "^2.0.0-beta.41",
|
||||||
"@vuepress/plugin-theme-data": "^2.0.0-beta.38",
|
"@vuepress/plugin-theme-data": "^2.0.0-beta.41",
|
||||||
"@vuepress/plugin-toc": "^2.0.0-beta.38",
|
"@vuepress/plugin-toc": "^2.0.0-beta.41",
|
||||||
"@vuepress/shared": "^2.0.0-beta.38",
|
"@vuepress/shared": "^2.0.0-beta.41",
|
||||||
"@vuepress/utils": "^2.0.0-beta.38",
|
"@vuepress/utils": "^2.0.0-beta.41",
|
||||||
"@vueuse/core": "^8.2.3",
|
"@vueuse/core": "^8.2.3",
|
||||||
"chokidar": "^3.5.3",
|
"chokidar": "^3.5.3",
|
||||||
"date-fns": "^2.28.0",
|
"date-fns": "^2.28.0",
|
||||||
@ -62,6 +62,14 @@
|
|||||||
"vuepress-plugin-seo2": "^2.0.0-beta.47",
|
"vuepress-plugin-seo2": "^2.0.0-beta.47",
|
||||||
"vuepress-plugin-sitemap2": "^2.0.0-beta.47"
|
"vuepress-plugin-sitemap2": "^2.0.0-beta.47"
|
||||||
},
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"sass-loader": "^12.6.0"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"sass-loader": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
},
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"access": "public"
|
"access": "public"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
import { defineClientAppEnhance } from '@vuepress/client'
|
import { defineClientAppEnhance } from '@vuepress/client'
|
||||||
import type { Component } from 'vue'
|
|
||||||
import { h } from 'vue'
|
import { h } from 'vue'
|
||||||
import { useScrollPromise } from './composables'
|
import { useScrollPromise } from './composables'
|
||||||
|
|
||||||
@ -7,14 +6,22 @@ import './styles/index.scss'
|
|||||||
|
|
||||||
export default defineClientAppEnhance(({ app, router }) => {
|
export default defineClientAppEnhance(({ app, router }) => {
|
||||||
app.component('NavbarSearch', () => {
|
app.component('NavbarSearch', () => {
|
||||||
const SearchComponent = (app.component('Docsearch') ||
|
const SearchComponent =
|
||||||
app.component('SearchBox')) as Component
|
app.component('Docsearch') || app.component('SearchBox')
|
||||||
if (SearchComponent) {
|
if (SearchComponent) {
|
||||||
return h(SearchComponent)
|
return h(SearchComponent)
|
||||||
}
|
}
|
||||||
return null
|
return null
|
||||||
})
|
})
|
||||||
|
|
||||||
|
app.component('Comment', (props) => {
|
||||||
|
const CommentService = app.component('CommentService')
|
||||||
|
if (CommentService) {
|
||||||
|
return h(CommentService, props)
|
||||||
|
}
|
||||||
|
return null
|
||||||
|
})
|
||||||
|
|
||||||
const scrollBehavior = router.options.scrollBehavior!
|
const scrollBehavior = router.options.scrollBehavior!
|
||||||
router.options.scrollBehavior = async (...args) => {
|
router.options.scrollBehavior = async (...args) => {
|
||||||
await useScrollPromise().wait()
|
await useScrollPromise().wait()
|
||||||
|
|||||||
@ -22,6 +22,7 @@ const bannerStyle = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
function handleResize(): void {
|
function handleResize(): void {
|
||||||
|
if (__VUEPRESS_SSR__) return
|
||||||
const width = document.documentElement.offsetWidth
|
const width = document.documentElement.offsetWidth
|
||||||
if (!hasBanner.value) return
|
if (!hasBanner.value) return
|
||||||
if (width < MOBILE_WIDTH) {
|
if (width < MOBILE_WIDTH) {
|
||||||
|
|||||||
@ -19,26 +19,6 @@ const isNote = computed(() => {
|
|||||||
const enabledSidebar = computed(() => {
|
const enabledSidebar = computed(() => {
|
||||||
return isNote.value
|
return isNote.value
|
||||||
})
|
})
|
||||||
|
|
||||||
let layout: HTMLElement | null
|
|
||||||
watchEffect(async () => {
|
|
||||||
await nextTick()
|
|
||||||
if (!enabledSidebar.value) return
|
|
||||||
layout = document.querySelector('.plume-theme')
|
|
||||||
const footer: HTMLElement | null = document.querySelector(
|
|
||||||
'.theme-plume-footer'
|
|
||||||
)
|
|
||||||
if (themeLocale.value.footer) {
|
|
||||||
const h = getCssValue(footer, 'height')
|
|
||||||
layout?.setAttribute('style', `padding-bottom: ${h}px`)
|
|
||||||
} else {
|
|
||||||
layout?.setAttribute('style', `padding-bottom: 0`)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
onUnmounted(() => {
|
|
||||||
layout?.removeAttribute('style')
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<DropdownTransition>
|
<DropdownTransition>
|
||||||
@ -52,7 +32,7 @@ onUnmounted(() => {
|
|||||||
<PostMeta :post="page" type="post" :border="true" />
|
<PostMeta :post="page" type="post" :border="true" />
|
||||||
<Content />
|
<Content />
|
||||||
<div class="comment-container">
|
<div class="comment-container">
|
||||||
<CommentService :darkmode="isDarkMode" />
|
<Comment :darkmode="isDarkMode" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="page.headers?.length > 0" class="plume-theme-page-toc">
|
<div v-if="page.headers?.length > 0" class="plume-theme-page-toc">
|
||||||
|
|||||||
@ -33,6 +33,7 @@ watch(
|
|||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|
||||||
onBeforeRouteUpdate((to) => {
|
onBeforeRouteUpdate((to) => {
|
||||||
|
if (__VUEPRESS_SSR__) return
|
||||||
setPostListPage((to.query.p as unknown as number) || 1)
|
setPostListPage((to.query.p as unknown as number) || 1)
|
||||||
const { home, banner, mobileBanner } = frontmatter.value
|
const { home, banner, mobileBanner } = frontmatter.value
|
||||||
let top = 0
|
let top = 0
|
||||||
|
|||||||
@ -1,16 +1,4 @@
|
|||||||
import type { UserConfig } from '@vuepress/cli'
|
import type { PlumeThemeNotesItem, PlumeThemeNotesOptions } from '../shared'
|
||||||
import type { BundlerConfig } from '@vuepress/core'
|
|
||||||
import type {
|
|
||||||
PlumeThemeNotesItem,
|
|
||||||
PlumeThemeNotesOptions,
|
|
||||||
PlumeThemeOptions,
|
|
||||||
} from '../shared'
|
|
||||||
|
|
||||||
type DefinePlumeConfig = UserConfig<PlumeThemeOptions, BundlerConfig>
|
|
||||||
|
|
||||||
export const definePlumeConfig = (
|
|
||||||
config: DefinePlumeConfig
|
|
||||||
): DefinePlumeConfig => config
|
|
||||||
|
|
||||||
export const definePlumeNotesConfig = (
|
export const definePlumeNotesConfig = (
|
||||||
notes: PlumeThemeNotesOptions
|
notes: PlumeThemeNotesOptions
|
||||||
|
|||||||
@ -15,7 +15,7 @@ function normalizePath(filepath: string): string {
|
|||||||
let uuid = 10000
|
let uuid = 10000
|
||||||
const cache: Record<string, number> = {}
|
const cache: Record<string, number> = {}
|
||||||
export const extendsPage = (
|
export const extendsPage = (
|
||||||
page: Page<PlumeThemePageData>,
|
page: Page<Partial<PlumeThemePageData>>,
|
||||||
localeOption: PlumeThemeLocaleOptions
|
localeOption: PlumeThemeLocaleOptions
|
||||||
): void => {
|
): void => {
|
||||||
const pagePath = page.filePathRelative || ''
|
const pagePath = page.filePathRelative || ''
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
import * as os from 'os'
|
|
||||||
import type { App } from '@vuepress/core'
|
import type { App } from '@vuepress/core'
|
||||||
import { fs, path } from '@vuepress/utils'
|
import { fs, path } from '@vuepress/utils'
|
||||||
import * as chokidar from 'chokidar'
|
import * as chokidar from 'chokidar'
|
||||||
@ -112,7 +111,7 @@ export const generateFrontmatter = (
|
|||||||
.stringify(data)
|
.stringify(data)
|
||||||
.replace(/\n\s{2}/g, '\n')
|
.replace(/\n\s{2}/g, '\n')
|
||||||
.replace(/"/g, '')
|
.replace(/"/g, '')
|
||||||
return `${yaml}---${os.EOL}${content}`
|
return `${yaml}---\n${content}`
|
||||||
}
|
}
|
||||||
|
|
||||||
const formatFrontmatter = (): void => {
|
const formatFrontmatter = (): void => {
|
||||||
|
|||||||
@ -1,14 +1,11 @@
|
|||||||
import type { PluginConfig } from '@vuepress/core'
|
import type { PluginObject } from '@vuepress/core'
|
||||||
import type { ActiveHeaderLinksPluginOptions } from '@vuepress/plugin-active-header-links'
|
import { activeHeaderLinksPlugin } from '@vuepress/plugin-active-header-links'
|
||||||
|
|
||||||
export const resolveActiveHeaderLink = (): PluginConfig => {
|
export const resolveActiveHeaderLink = (): PluginObject => {
|
||||||
return [
|
return activeHeaderLinksPlugin({
|
||||||
'@vuepress/active-header-links',
|
headerLinkSelector: 'a.theme-plume-toc-link',
|
||||||
{
|
headerAnchorSelector: '.header-anchor',
|
||||||
headerLinkSelector: 'a.theme-plume-toc-link',
|
delay: 200,
|
||||||
headerAnchorSelector: '.header-anchor',
|
offset: 20,
|
||||||
delay: 200,
|
})
|
||||||
offset: 20,
|
|
||||||
} as ActiveHeaderLinksPluginOptions,
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,14 +1,14 @@
|
|||||||
import type { PluginConfig } from '@vuepress/core'
|
import { caniusePlugin } from '@vuepress-plume/vuepress-plugin-caniuse'
|
||||||
|
import type { PluginObject } from '@vuepress/core'
|
||||||
import type { PlumeThemePluginOptions } from '../../shared'
|
import type { PlumeThemePluginOptions } from '../../shared'
|
||||||
|
|
||||||
export const resolveCanIUse = (
|
export const resolveCanIUse = (
|
||||||
plugins: PlumeThemePluginOptions
|
plugins: PlumeThemePluginOptions
|
||||||
): PluginConfig => {
|
): PluginObject | false => {
|
||||||
if (plugins.caniuse === false) return ['', false]
|
if (plugins.caniuse === false) return false
|
||||||
return [
|
return caniusePlugin(
|
||||||
'@vuepress-plume/caniuse',
|
|
||||||
plugins.caniuse || {
|
plugins.caniuse || {
|
||||||
mode: 'embed',
|
mode: 'embed',
|
||||||
},
|
}
|
||||||
]
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,11 +1,12 @@
|
|||||||
import type { PluginConfig } from '@vuepress/core'
|
import type { PluginObject } from '@vuepress/core'
|
||||||
import type { CommentOptions } from 'vuepress-plugin-comment2'
|
// import type { CommentOptions } from 'vuepress-plugin-comment2'
|
||||||
import { comment } from 'vuepress-plugin-comment2'
|
// import { commentPlugin } from 'vuepress-plugin-comment2'
|
||||||
import type { PlumeThemePluginOptions } from '../../shared'
|
import type { PlumeThemePluginOptions } from '../../shared'
|
||||||
|
|
||||||
export const resolveComment = (
|
export const resolveComment = (
|
||||||
plugins: PlumeThemePluginOptions
|
plugins: PlumeThemePluginOptions
|
||||||
): PluginConfig => {
|
): PluginObject | false => {
|
||||||
if (plugins.comment === false) return ['', false]
|
if (plugins.comment === false) return false
|
||||||
return comment(plugins.comment as CommentOptions)
|
// return commentPlugin(plugins.comment as CommentOptions)
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,21 +1,22 @@
|
|||||||
import type { PluginConfig } from '@vuepress/core'
|
import type { PluginObject } from '@vuepress/core'
|
||||||
import { copyCode } from 'vuepress-plugin-copy-code2'
|
// import { copyCodePlugin } from 'vuepress-plugin-copy-code2'
|
||||||
import type { PlumeThemePluginOptions } from '../../shared'
|
import type { PlumeThemePluginOptions } from '../../shared'
|
||||||
|
|
||||||
export const resolveCopyCode = (
|
export const resolveCopyCode = (
|
||||||
plugins: PlumeThemePluginOptions
|
plugins: PlumeThemePluginOptions
|
||||||
): PluginConfig => {
|
): PluginObject | false => {
|
||||||
if (plugins.copyCode === false) return ['', false]
|
if (plugins.copyCode === false) return false
|
||||||
|
|
||||||
return copyCode(
|
// return copyCodePlugin(
|
||||||
plugins.copyCode || {
|
// plugins.copyCode || {
|
||||||
selector: '.page-content div[class*="language-"] pre',
|
// selector: '.page-content div[class*="language-"] pre',
|
||||||
locales: {
|
// locales: {
|
||||||
'/': {
|
// '/': {
|
||||||
copy: '复制成功',
|
// copy: '复制成功',
|
||||||
hint: '复制代码',
|
// hint: '复制代码',
|
||||||
},
|
// },
|
||||||
},
|
// },
|
||||||
}
|
// }
|
||||||
)
|
// )
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import type { PluginConfig } from '@vuepress/core'
|
import type { PluginObject } from '@vuepress/core'
|
||||||
import type { ExternalLinkIconPluginOptions } from '@vuepress/plugin-external-link-icon'
|
import { externalLinkIconPlugin } from '@vuepress/plugin-external-link-icon'
|
||||||
import type {
|
import type {
|
||||||
PlumeThemeLocaleOptions,
|
PlumeThemeLocaleOptions,
|
||||||
PlumeThemePluginOptions,
|
PlumeThemePluginOptions,
|
||||||
@ -8,21 +8,18 @@ import type {
|
|||||||
export const resolveExternalLinkIconPlugin = (
|
export const resolveExternalLinkIconPlugin = (
|
||||||
plugins: PlumeThemePluginOptions,
|
plugins: PlumeThemePluginOptions,
|
||||||
localeOptions: PlumeThemeLocaleOptions
|
localeOptions: PlumeThemeLocaleOptions
|
||||||
): PluginConfig => {
|
): PluginObject | false => {
|
||||||
if (plugins.externalLinkIcon === false) return ['', false]
|
if (plugins.externalLinkIcon === false) return false
|
||||||
return [
|
return externalLinkIconPlugin({
|
||||||
'@vuepress/plugin-external-link-icon',
|
locales: Object.entries(localeOptions.locales || {}).reduce(
|
||||||
{
|
(result, [key, value]) => {
|
||||||
locales: Object.entries(localeOptions.locales || {}).reduce(
|
result[key] = {
|
||||||
(result, [key, value]) => {
|
openInNewWindow:
|
||||||
result[key] = {
|
value.openInNewWindow ?? localeOptions.openInNewWindow,
|
||||||
openInNewWindow:
|
}
|
||||||
value.openInNewWindow ?? localeOptions.openInNewWindow,
|
return result
|
||||||
}
|
},
|
||||||
return result
|
{}
|
||||||
},
|
),
|
||||||
{}
|
})
|
||||||
),
|
|
||||||
} as ExternalLinkIconPluginOptions,
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,42 +1,42 @@
|
|||||||
import type { App, PluginConfig, PluginOptions } from '@vuepress/core'
|
import type { PluginConfig, PluginObject } from '@vuepress/core'
|
||||||
import type {
|
import type {
|
||||||
PlumeThemeLocaleOptions,
|
PlumeThemeLocaleOptions,
|
||||||
PlumeThemePluginOptions,
|
PlumeThemePluginOptions,
|
||||||
} from '../../shared'
|
} from '../../shared'
|
||||||
import { resolveActiveHeaderLink } from './activeHeaderLink'
|
import { resolveActiveHeaderLink } from './activeHeaderLink'
|
||||||
import { resolveCanIUse } from './caniuse'
|
import { resolveCanIUse } from './caniuse'
|
||||||
import { resolveComment } from './comment'
|
// import { resolveComment } from './comment'
|
||||||
import { resolveCopyCode } from './copyCode'
|
// import { resolveCopyCode } from './copyCode'
|
||||||
import { resolveExternalLinkIconPlugin } from './externalLinkIcon'
|
import { resolveExternalLinkIconPlugin } from './externalLinkIcon'
|
||||||
import { resolveMarkdownEnhance } from './markdownEnhance'
|
// import { resolveMarkdownEnhance } from './markdownEnhance'
|
||||||
import { resolveMediumZoom } from './mediumZoom'
|
import { resolveMediumZoom } from './mediumZoom'
|
||||||
import { resolveNprogress } from './nprogress'
|
import { resolveNprogress } from './nprogress'
|
||||||
import { resolvePalette } from './palette'
|
import { resolvePalette } from './palette'
|
||||||
import { resolvePrismjs } from './prismjs'
|
import { resolvePrismjs } from './prismjs'
|
||||||
import { resolveSearch } from './search'
|
// import { resolveSearch } from './search'
|
||||||
import { resolveSeo } from './seo'
|
// import { resolveSeo } from './seo'
|
||||||
import { resolveSitemap } from './sitemap'
|
// import { resolveSitemap } from './sitemap'
|
||||||
import { resolveThemeData } from './themeData'
|
import { resolveThemeData } from './themeData'
|
||||||
|
|
||||||
export const getPlugins = (
|
export const getPlugins = (
|
||||||
app: App,
|
|
||||||
plugins: PlumeThemePluginOptions,
|
plugins: PlumeThemePluginOptions,
|
||||||
localeOptions: PlumeThemeLocaleOptions
|
localeOptions: PlumeThemeLocaleOptions
|
||||||
): PluginConfig<PluginOptions>[] => {
|
): PluginConfig => {
|
||||||
return [
|
const resolvePlugins: (PluginObject | false)[] = [
|
||||||
resolveActiveHeaderLink(),
|
resolveActiveHeaderLink(),
|
||||||
resolvePalette(),
|
resolvePalette(),
|
||||||
resolveNprogress(plugins),
|
resolveNprogress(plugins),
|
||||||
resolveMediumZoom(plugins),
|
resolveMediumZoom(plugins),
|
||||||
resolveCanIUse(plugins),
|
resolveCanIUse(plugins),
|
||||||
resolveExternalLinkIconPlugin(plugins, localeOptions),
|
resolveExternalLinkIconPlugin(plugins, localeOptions),
|
||||||
resolveSearch(plugins),
|
// resolveSearch(plugins),
|
||||||
resolvePrismjs(plugins),
|
resolvePrismjs(plugins),
|
||||||
resolveCopyCode(plugins),
|
// resolveCopyCode(plugins),
|
||||||
resolveMarkdownEnhance(plugins),
|
// resolveMarkdownEnhance(plugins),
|
||||||
resolveComment(plugins),
|
// resolveComment(plugins),
|
||||||
resolveSitemap(plugins, localeOptions),
|
// resolveSitemap(plugins, localeOptions),
|
||||||
resolveSeo(plugins, localeOptions),
|
// resolveSeo(plugins, localeOptions),
|
||||||
resolveThemeData(localeOptions),
|
resolveThemeData(localeOptions),
|
||||||
].filter((item) => item[1] !== false)
|
]
|
||||||
|
return resolvePlugins.filter((plugin) => plugin) as PluginObject[]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,22 +1,23 @@
|
|||||||
import type { PluginConfig } from '@vuepress/core'
|
import type { PluginObject } from '@vuepress/core'
|
||||||
import { mdEnhance } from 'vuepress-plugin-md-enhance'
|
// import { mdEnhancePlugin } from 'vuepress-plugin-md-enhance'
|
||||||
import type { PlumeThemePluginOptions } from '../../shared'
|
import type { PlumeThemePluginOptions } from '../../shared'
|
||||||
|
|
||||||
export const resolveMarkdownEnhance = (
|
export const resolveMarkdownEnhance = (
|
||||||
plugins: PlumeThemePluginOptions
|
plugins: PlumeThemePluginOptions
|
||||||
): PluginConfig => {
|
): PluginObject | false => {
|
||||||
if (plugins.markdownEnhance === false) return ['', false]
|
if (plugins.markdownEnhance === false) return false
|
||||||
return mdEnhance(
|
// return mdEnhancePlugin(
|
||||||
Object.assign(
|
// Object.assign(
|
||||||
{
|
// {
|
||||||
container: true, // info note tip warning danger details
|
// container: true, // info note tip warning danger details
|
||||||
codegroup: true,
|
// codegroup: true,
|
||||||
align: true,
|
// align: true,
|
||||||
mark: true,
|
// mark: true,
|
||||||
tasklist: true,
|
// tasklist: true,
|
||||||
demo: true,
|
// demo: true,
|
||||||
},
|
// },
|
||||||
plugins.markdownEnhance || {}
|
// plugins.markdownEnhance || {}
|
||||||
)
|
// )
|
||||||
)
|
// )
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,16 +1,14 @@
|
|||||||
import type { PluginConfig } from '@vuepress/core'
|
import type { PluginObject } from '@vuepress/core'
|
||||||
|
import { mediumZoomPlugin } from '@vuepress/plugin-medium-zoom'
|
||||||
import type { PlumeThemePluginOptions } from '../../shared'
|
import type { PlumeThemePluginOptions } from '../../shared'
|
||||||
|
|
||||||
export const resolveMediumZoom = (
|
export const resolveMediumZoom = (
|
||||||
plugins: PlumeThemePluginOptions
|
plugins: PlumeThemePluginOptions
|
||||||
): PluginConfig => {
|
): PluginObject | false => {
|
||||||
if (plugins.mediumZoom === false) return ['', false]
|
if (plugins.mediumZoom === false) return false
|
||||||
return [
|
return mediumZoomPlugin({
|
||||||
'@vuepress/medium-zoom',
|
selector: '.page-content > img, .page-content :not(a) > img',
|
||||||
{
|
zoomOptions: {},
|
||||||
selector: '.page-content > img, .page-content :not(a) > img',
|
delay: 300,
|
||||||
zoomOption: {},
|
})
|
||||||
delay: 300,
|
|
||||||
},
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,9 +1,10 @@
|
|||||||
import type { PluginConfig } from '@vuepress/core'
|
import type { PluginObject } from '@vuepress/core'
|
||||||
|
import { nprogressPlugin } from '@vuepress/plugin-nprogress'
|
||||||
import type { PlumeThemePluginOptions } from '../../shared'
|
import type { PlumeThemePluginOptions } from '../../shared'
|
||||||
|
|
||||||
export const resolveNprogress = (
|
export const resolveNprogress = (
|
||||||
plugins: PlumeThemePluginOptions
|
plugins: PlumeThemePluginOptions
|
||||||
): PluginConfig => {
|
): PluginObject | false => {
|
||||||
if (plugins.nprogress === false) return ['', false]
|
if (plugins.nprogress === false) return false
|
||||||
return ['@vuepress/nprogress', true]
|
return nprogressPlugin()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import type { PluginConfig } from '@vuepress/core'
|
import type { PluginObject } from '@vuepress/core'
|
||||||
|
import { palettePlugin } from '@vuepress/plugin-palette'
|
||||||
|
|
||||||
export const resolvePalette = (): PluginConfig => {
|
export const resolvePalette = (): PluginObject => {
|
||||||
return ['@vuepress/plugin-palette', { preset: 'sass' }]
|
return palettePlugin({ preset: 'sass' })
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,9 +1,10 @@
|
|||||||
import type { PluginConfig } from '@vuepress/core'
|
import type { PluginObject } from '@vuepress/core'
|
||||||
|
import { prismjsPlugin } from '@vuepress/plugin-prismjs'
|
||||||
import type { PlumeThemePluginOptions } from '../../shared'
|
import type { PlumeThemePluginOptions } from '../../shared'
|
||||||
|
|
||||||
export const resolvePrismjs = (
|
export const resolvePrismjs = (
|
||||||
plugins: PlumeThemePluginOptions
|
plugins: PlumeThemePluginOptions
|
||||||
): PluginConfig => {
|
): PluginObject | false => {
|
||||||
if (plugins.prismjs === false) return ['', false]
|
if (plugins.prismjs === false) return false
|
||||||
return ['@vuepress/prismjs', true]
|
return prismjsPlugin()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,41 +1,16 @@
|
|||||||
import type { PluginConfig } from '@vuepress/core'
|
import type { PluginObject } from '@vuepress/core'
|
||||||
import { logger } from '@vuepress/utils'
|
import { docsearchPlugin } from '@vuepress/plugin-docsearch'
|
||||||
|
import { searchPlugin } from '@vuepress/plugin-search'
|
||||||
import type { PlumeThemePluginOptions } from '../../shared'
|
import type { PlumeThemePluginOptions } from '../../shared'
|
||||||
|
|
||||||
const hasDocsearchInstalled = (): boolean => {
|
|
||||||
try {
|
|
||||||
require.resolve('@vuepress/plugin-docsearch')
|
|
||||||
return true
|
|
||||||
} catch {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const hasSearchInstalled = (): boolean => {
|
|
||||||
try {
|
|
||||||
require.resolve('@vuepress/plugin-search')
|
|
||||||
return true
|
|
||||||
} catch {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export const resolveSearch = (
|
export const resolveSearch = (
|
||||||
plugins: PlumeThemePluginOptions
|
plugins: PlumeThemePluginOptions
|
||||||
): PluginConfig => {
|
): PluginObject | false => {
|
||||||
if (plugins.search) {
|
if (plugins.search !== false) {
|
||||||
if (!hasSearchInstalled() || plugins.search === false) {
|
return searchPlugin(plugins.search)
|
||||||
logger.error('@vuepress/plugin-search is not installed.')
|
|
||||||
return ['', false]
|
|
||||||
}
|
|
||||||
return ['@vuepress/search', plugins.search]
|
|
||||||
}
|
}
|
||||||
if (plugins.docsearch) {
|
if (plugins.docsearch) {
|
||||||
if (!hasDocsearchInstalled() || plugins.docsearch === false) {
|
return docsearchPlugin(plugins.docsearch)
|
||||||
logger.error('@vuepress/plugin-docsearch is not installed.')
|
|
||||||
return ['', false]
|
|
||||||
}
|
|
||||||
return ['@vuepress/docsearch', plugins.docsearch]
|
|
||||||
}
|
}
|
||||||
return ['', false]
|
return false
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import type { PluginConfig } from '@vuepress/core'
|
import type { PluginObject } from '@vuepress/core'
|
||||||
import { seo } from 'vuepress-plugin-seo2'
|
// import { seoPlugin } from 'vuepress-plugin-seo2'
|
||||||
import type {
|
import type {
|
||||||
PlumeThemeLocaleOptions,
|
PlumeThemeLocaleOptions,
|
||||||
PlumeThemePluginOptions,
|
PlumeThemePluginOptions,
|
||||||
@ -8,10 +8,11 @@ import type {
|
|||||||
export const resolveSeo = (
|
export const resolveSeo = (
|
||||||
plugins: PlumeThemePluginOptions,
|
plugins: PlumeThemePluginOptions,
|
||||||
localeOptions: PlumeThemeLocaleOptions
|
localeOptions: PlumeThemeLocaleOptions
|
||||||
): PluginConfig => {
|
): PluginObject | false => {
|
||||||
if (plugins.sitemap === false || !localeOptions.hostname) return ['', false]
|
if (plugins.sitemap === false || !localeOptions.hostname) return false
|
||||||
return seo({
|
// return seoPlugin({
|
||||||
hostname: localeOptions.hostname,
|
// hostname: localeOptions.hostname,
|
||||||
author: localeOptions.avatar?.name,
|
// author: localeOptions.avatar?.name,
|
||||||
})
|
// })
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import type { PluginConfig } from '@vuepress/core'
|
import type { PluginObject } from '@vuepress/core'
|
||||||
import { sitemap } from 'vuepress-plugin-sitemap2'
|
// import { sitemapPlugin } from 'vuepress-plugin-sitemap2'
|
||||||
import type {
|
import type {
|
||||||
PlumeThemeLocaleOptions,
|
PlumeThemeLocaleOptions,
|
||||||
PlumeThemePluginOptions,
|
PlumeThemePluginOptions,
|
||||||
@ -8,9 +8,10 @@ import type {
|
|||||||
export const resolveSitemap = (
|
export const resolveSitemap = (
|
||||||
plugins: PlumeThemePluginOptions,
|
plugins: PlumeThemePluginOptions,
|
||||||
localeOptions: PlumeThemeLocaleOptions
|
localeOptions: PlumeThemeLocaleOptions
|
||||||
): PluginConfig => {
|
): PluginObject | false => {
|
||||||
if (plugins.sitemap === false || !localeOptions.hostname) return ['', false]
|
if (plugins.sitemap === false || !localeOptions.hostname) return false
|
||||||
return sitemap({
|
// return sitemapPlugin({
|
||||||
hostname: localeOptions.hostname,
|
// hostname: localeOptions.hostname,
|
||||||
})
|
// })
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
import type { PluginConfig } from '@vuepress/core'
|
import type { PluginObject } from '@vuepress/core'
|
||||||
|
import { themeDataPlugin } from '@vuepress/plugin-theme-data'
|
||||||
import type { PlumeThemeLocaleOptions } from '../../shared'
|
import type { PlumeThemeLocaleOptions } from '../../shared'
|
||||||
|
|
||||||
export const resolveThemeData = (
|
export const resolveThemeData = (
|
||||||
localeOptions: PlumeThemeLocaleOptions
|
localeOptions: PlumeThemeLocaleOptions
|
||||||
): PluginConfig => {
|
): PluginObject => {
|
||||||
return ['@vuepress/theme-data', { themeData: localeOptions }]
|
return themeDataPlugin({ themeData: localeOptions })
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import type { Page, Theme } from '@vuepress/core'
|
import type { App, Page, Theme } from '@vuepress/core'
|
||||||
import type { PlumeThemeOptions, PlumeThemePageData } from '../shared'
|
import type { PlumeThemeOptions, PlumeThemePageData } from '../shared'
|
||||||
import { getAlias } from './alias'
|
import { getAlias } from './alias'
|
||||||
import { createPage } from './createPage'
|
import { createPage } from './createPage'
|
||||||
@ -10,29 +10,12 @@ import { onPrepared, preparedWatch } from './prepared'
|
|||||||
import { resolveClient, resolveTemplate } from './utils'
|
import { resolveClient, resolveTemplate } from './utils'
|
||||||
const merge = require('lodash.merge')
|
const merge = require('lodash.merge')
|
||||||
|
|
||||||
export const themePlume: Theme<PlumeThemeOptions> = (
|
export const themePlume = ({
|
||||||
{ themePlugins = {}, ...localeOption },
|
themePlugins = {},
|
||||||
app
|
...localeOption
|
||||||
) => {
|
}: PlumeThemeOptions = {}): Theme => {
|
||||||
if (app.options.bundler.endsWith('vite')) {
|
|
||||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
||||||
app.options.bundlerConfig.viteOptions = require('vite').mergeConfig(
|
|
||||||
app.options.bundlerConfig.viteOptions,
|
|
||||||
{
|
|
||||||
css: {
|
|
||||||
preprocessorOptions: {
|
|
||||||
scss: { charset: false },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
localeOption = merge(defaultLocaleOption, localeOption)
|
localeOption = merge(defaultLocaleOption, localeOption)
|
||||||
const { formatFrontmatter, watchNewMarkDown } = generateFrontmatter(
|
let watchMarkdown: null | ((app: App, watchers: unknown) => void) = null
|
||||||
app.options.source,
|
|
||||||
localeOption
|
|
||||||
)
|
|
||||||
formatFrontmatter()
|
|
||||||
return {
|
return {
|
||||||
name: '@vuepress-plume/vuepress-theme-plume',
|
name: '@vuepress-plume/vuepress-theme-plume',
|
||||||
layouts: resolveClient('layouts'),
|
layouts: resolveClient('layouts'),
|
||||||
@ -41,15 +24,21 @@ export const themePlume: Theme<PlumeThemeOptions> = (
|
|||||||
clientAppEnhanceFiles: resolveClient('clientAppEnhance.js'),
|
clientAppEnhanceFiles: resolveClient('clientAppEnhance.js'),
|
||||||
clientAppSetupFiles: resolveClient('clientAppSetup.js'),
|
clientAppSetupFiles: resolveClient('clientAppSetup.js'),
|
||||||
onInitialized: async (app) => {
|
onInitialized: async (app) => {
|
||||||
|
const { formatFrontmatter, watchNewMarkDown } = generateFrontmatter(
|
||||||
|
app.options.source,
|
||||||
|
localeOption
|
||||||
|
)
|
||||||
|
watchMarkdown = watchNewMarkDown
|
||||||
|
formatFrontmatter()
|
||||||
await createPage(app, localeOption)
|
await createPage(app, localeOption)
|
||||||
},
|
},
|
||||||
onPrepared: (app) => onPrepared(app, localeOption),
|
onPrepared: (app) => onPrepared(app, localeOption),
|
||||||
extendsPage: (page: Page<PlumeThemePageData>) =>
|
extendsPage: (page: Page<Partial<PlumeThemePageData>>) =>
|
||||||
extendsPage(page, localeOption),
|
extendsPage(page, localeOption),
|
||||||
onWatched: (app, watchers) => {
|
onWatched: (app, watchers) => {
|
||||||
preparedWatch(app, watchers, localeOption)
|
preparedWatch(app, watchers, localeOption)
|
||||||
watchNewMarkDown(app, watchers)
|
watchMarkdown && watchMarkdown(app, watchers)
|
||||||
},
|
},
|
||||||
plugins: getPlugins(app, themePlugins, localeOption),
|
plugins: getPlugins(themePlugins, localeOption),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,11 +1,8 @@
|
|||||||
import type { ThemeConfig } from '@vuepress/core'
|
|
||||||
import type { ThemeData } from '@vuepress/plugin-theme-data'
|
import type { ThemeData } from '@vuepress/plugin-theme-data'
|
||||||
import type { PlumeThemeLocaleData } from './locale'
|
import type { PlumeThemeLocaleData } from './locale'
|
||||||
import type { PlumeThemePluginOptions } from './plugin'
|
import type { PlumeThemePluginOptions } from './plugin'
|
||||||
|
|
||||||
export interface PlumeThemeOptions
|
export interface PlumeThemeOptions extends PlumeThemeLocaleOptions {
|
||||||
extends ThemeConfig,
|
|
||||||
PlumeThemeLocaleOptions {
|
|
||||||
/**
|
/**
|
||||||
* 对主题内部使用的插件进行配置
|
* 对主题内部使用的插件进行配置
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -23,7 +23,7 @@ export interface PlumeThemePluginOptions {
|
|||||||
/**
|
/**
|
||||||
* plugin-docsearch 配置
|
* plugin-docsearch 配置
|
||||||
*/
|
*/
|
||||||
docsearch?: false | Partial<DocsearchOptions>
|
docsearch?: false | DocsearchOptions
|
||||||
|
|
||||||
prismjs?: false
|
prismjs?: false
|
||||||
|
|
||||||
|
|||||||
@ -3,28 +3,18 @@
|
|||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"baseUrl": "./",
|
"baseUrl": "./",
|
||||||
"module": "ES2020",
|
"module": "ES2020",
|
||||||
// "jsx": "preserve",
|
"jsx": "preserve",
|
||||||
"paths": {
|
"paths": {
|
||||||
"@theme-plume/*": [
|
"@theme-plume/*": ["./packages/theme/src/client/components/*"],
|
||||||
"./packages/theme/src/client/components/*"
|
"@internal/*": ["./docs/.vuepress/.temp/internal/*"],
|
||||||
],
|
"@vuepress-plume/vuepress-*": ["./packages/*/src"],
|
||||||
"@internal/*": [
|
"@vuepress-plume/vuepress-theme-plume": ["./packages/theme/src"]
|
||||||
"./docs/.vuepress/.temp/internal/*"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"types": ["webpack-env", "vite/client", "@vuepress/client/types"]
|
"types": ["webpack-env", "vite/client", "@vuepress/client/types"]
|
||||||
},
|
},
|
||||||
"vueCompilerOptions": {
|
"vueCompilerOptions": {
|
||||||
"experimentalDisableTemplateSupport": true
|
"experimentalDisableTemplateSupport": true
|
||||||
},
|
},
|
||||||
"include": [
|
"include": ["packages/**/*", "docs/.vuepress/**/*"],
|
||||||
"packages/**/*",
|
"exclude": ["node_modules", ".temp", "lib", "dist"]
|
||||||
"docs/.vuepress/**/*"
|
|
||||||
],
|
|
||||||
"exclude": [
|
|
||||||
"node_modules",
|
|
||||||
".temp",
|
|
||||||
"lib",
|
|
||||||
"dist"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user