Skip to content

@142vip/vuepress

NPM versionVuePress使用的最佳实践,基于vuepress-theme-hope插件封装

使用

shell
# npm
npm install @142vip/vuepress -D
# pnpm
pnpm i @142vip/vuepress -D

配置

在根目录新建vuepress.config.ts文件,配置参考:

ts
import {
  defineVipVuepressConfig,
  getVipHopeTheme,
  handleImportCodePath,
} from '@142vip/vuepress'

export default defineVipVuepressConfig({
  // 基础配置
  // ...

  // 支持中文
  locales: {
    '/': {
      lang: 'zh-CN',
    },
  },

  // markdown配置
  markdown: {
    // 导入代码
    importCode: {
      handleImportPath: handleImportCodePath([
        ['@code', 'code/'],
        ['~', ''],
      ]),
    },
    headers: {
      level: [2, 3, 4],
    },
  },
  // 主题配置
  theme: getVipHopeTheme({
    // 一些主题配置
    // ...

    // changelog和贡献者
    // changelog: true,
    // contributors: true,

  }),
})

命令

shell
# 本地开发
npx vuepress dev

# 编辑
npx vuepress build

证书

MIT

Copyright (c) 2019-present, @142vip 储凡

仅供学习参考,商业使用请保留作者版权信息,作者不保证也不承担任何软件的使用风险。