# @142vip/vuepress

[![NPM version](https://img.shields.io/npm/v/@142vip/vuepress?labelColor=0b3d52&color=1da469&label=version)](https://www.npmjs.com/package/@142vip/vuepress)
`VuePress`使用的最佳实践，基于`vuepress-theme-hope`插件封装

## 使用

安装本包即可，**VuePress 运行时与主题依赖已内置**（版本见 `package.json` 的 `dependencies`），无需再单独安装 `vuepress` / `vuepress-theme-hope` 等：

```shell
pnpm add -D @142vip/vuepress
```

## 配置

在根目录新建`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](https://opensource.org/license/MIT)

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

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