Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Commit 0a3449a

Browse files
Mister-Hopeulivzbillyyyyy3320
authored
docs: add zh docs (#70)
* docs: add zh docs * choreUpdate docs/.vuepress/config.js Co-authored-by: Billyyyyy3320 <[email protected]> * chore: update docs/zh/client-api/README.md Co-authored-by: Billyyyyy3320 <[email protected]> * chore: update docs/zh/guide/README.md Co-authored-by: Billyyyyy3320 <[email protected]> * chore: update docs/zh/guide/README.md Co-authored-by: Billyyyyy3320 <[email protected]> * chore: update docs/zh/guide/README.md Co-authored-by: Billyyyyy3320 <[email protected]> * chore: update docs/zh/guide/README.md Co-authored-by: Billyyyyy3320 <[email protected]> Co-authored-by: ULIVZ <[email protected]> Co-authored-by: Billyyyyy3320 <[email protected]>
1 parent 2703b34 commit 0a3449a

File tree

10 files changed

+1275
-6
lines changed

10 files changed

+1275
-6
lines changed

README.zh-CN.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# @vuepress/plugin-blog
2+
3+
> VuePress 的官方博客插件。
4+
5+
## 特性
6+
7+
- [**分类器**](https://vuepress-plugin-blog.ulivz.com/zh/guide/getting-started.html#文档分类器)
8+
强大的分类系统可让你快速对帖子进行分类。
9+
- [**分页**](https://vuepress-plugin-blog.ulivz.com/zh/guide/getting-started.html#分页)
10+
分页贯穿整个插件,它从未如此简单。
11+
- [**客户端 API**](https://vuepress-plugin-blog.ulivz.com/zh/client-api/):简单的客户端 API 使你可以更轻松地编写博客主题。
12+
13+
## 安装
14+
15+
我们强烈建议你在使用此插件之前阅读 [Getting Started](https://vuepress-plugin-blog.ulivz.com/guide/getting-started.html) 部分。
16+
17+
```bash
18+
yarn add -D @vuepress/plugin-blog
19+
# OR npm install -D @vuepress/plugin-blog
20+
```
21+
22+
## 使用
23+
24+
```javascript
25+
module.exports = {
26+
plugins: ['@vuepress/blog']
27+
};
28+
```
29+
30+
请转到 [文档](https://vuepress-theme-blog.ulivz.com/zh/) 查看所有可用选项。
31+
32+
## 正在使用 `@vuepress/plugin-blog` 的项目
33+
34+
- [70-lines-of-vuepress-blog-theme](https://github.com/ulivz/70-lines-of-vuepress-blog-theme): 大约 70 行实现的 VuePress 博客主题。
35+
- [@vuepress/theme-blog](https://github.com/ulivz/vuepress-theme-blog): VuePress 的默认博客主题。
36+
- [vuepress-theme-modern-blog](https://github.com/z3by/vuepress-theme-modern-blog): 一个使用 [Element.UI 设计系统](https://element.eleme.io/#/) 的现代主题
37+
- [vuepress-theme-reco](https://github.com/vuepress-reco/vuepress-theme-reco) - 一个简单美观的 vuepress 博客主题
38+
- [vuepress-theme-yuchanns](https://github.com/yuchanns/vuepress-theme-yuchanns): 一个 Github 风格的 vuepress 博客主题
39+
- [vuepress-theme-ic](https://github.com/IKangXu/vuepress-theme-ic) :tada::tada::tada: 笔记样式的vuepress博客主题,具有简单,清晰和实用的功能。最浅的墨水比最好的记忆好。
40+
- [vuepress-theme-hope](https://vuepress-theme.mrhope.site/): :zap: 一个轻量的 vuepress 主题
41+
42+
随时在这里添加你的主题...
43+
44+
## 作者
45+
46+
**@vuepress/theme-blog** © [ULIVZ](https://github.com/ulivz), 在 [MIT](./LICENSE) 许可证下发布。<br>
47+
48+
> [github.com/ulivz](https://github.com/ulivz) · GitHub [@ULIVZ](https://github.com/ulivz) · Twitter [@\_ulivz](https://twitter.com/_ulivz)

docs/.vuepress/config.js

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
module.exports = {
22
title: '@vuepress/plugin-blog',
3+
description: 'Offical blog plugin for VuePress',
4+
locales: {
5+
'/': {
6+
lang: 'en-US',
7+
},
8+
'/zh/': {
9+
lang: 'zh-CN',
10+
description: 'Vuepress 官方博客插件',
11+
},
12+
},
313
description: 'Official blog plugin for VuePress',
414
themeConfig: {
515
repo: 'vuepressjs/vuepress-plugin-blog',
@@ -12,7 +22,7 @@ module.exports = {
1222
{ text: 'Pagination', link: '/pagination/' },
1323
{ text: 'Client API', link: '/client-api/' },
1424
{ text: 'Components', link: '/components/' },
15-
{ text: 'FAQ', link: '/faq/' }
25+
{ text: 'FAQ', link: '/faq/' },
1626
],
1727
sidebarDepth: 3,
1828
sidebar: {
@@ -21,14 +31,36 @@ module.exports = {
2131
title: 'Guide',
2232
collapsable: false,
2333

24-
children: [
25-
'',
26-
'getting-started',
27-
],
34+
children: ['', 'getting-started'],
2835
},
2936
],
3037
},
38+
locales: {
39+
'/': {
40+
label: 'English',
41+
},
42+
'/zh/': {
43+
nav: [
44+
{ text: '指南', link: '/zh/guide/' },
45+
{ text: '配置', link: '/zh/config/' },
46+
{ text: '分页', link: '/zh/pagination/' },
47+
{ text: '客户端 API', link: '/zh/client-api/' },
48+
{ text: '组件', link: '/zh/components/' },
49+
{ text: 'FAQ', link: '/zh/faq/' },
50+
],
51+
sidebar: {
52+
'/zh/guide/': [
53+
{
54+
title: '指南',
55+
collapsable: false,
56+
children: ['', 'getting-started'],
57+
},
58+
],
59+
},
60+
selectText: '选择语言',
61+
label: '简体中文',
62+
},
63+
},
3164
smoothScroll: true,
3265
},
3366
}
34-

docs/zh/README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
home: true
3+
heroImage:
4+
actionText: 快速上手 →
5+
actionLink: /zh/guide/
6+
features:
7+
- title: 分类
8+
details: 强大的分类系统可让你快速对帖子进行分类。
9+
- title: 分页
10+
details: 分页贯穿整个插件,它从未如此简单。
11+
- title: 客户端 API
12+
details: 简单的客户端 API 使你可以更轻松地编写博客主题。
13+
14+
footer: MIT Licensed | Copyright © 2019-present ULIVZ
15+
---
16+
17+
## 安装
18+
19+
```bash
20+
yarn add -D @vuepress/plugin-blog
21+
# OR npm install -D @vuepress/plugin-blog
22+
```
23+
24+
## 使用
25+
26+
```javascript
27+
// .vuepress/config.js
28+
module.exports = {
29+
plugins: [
30+
'@vuepress/blog',
31+
{
32+
/* options */
33+
},
34+
],
35+
}
36+
```
37+
38+
[这里](./config/README.md) 可以找到所有可用的选项.

docs/zh/client-api/README.md

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
---
2+
sidebar: auto
3+
---
4+
5+
# 客户端 API
6+
7+
::: tip
8+
我们强烈建议你在使用此插件之前阅读 [快速上手](../guide/getting-started.md) 部分。
9+
:::
10+
11+
## $pagination
12+
13+
::: warning
14+
请注意,如果你在与任何分类都不匹配的路由上访问 `$pagination``$pagination` 的值将为 `null`
15+
16+
因此,当你开发布局组件时,你需要验证 `$pagination` 是否存在。
17+
:::
18+
19+
### `$pagination.pages`
20+
21+
当前路由的匹配页面。例如:
22+
23+
```json
24+
[
25+
{ "relativePath": "b.md", "path": "/b.html" ... },
26+
{ "relativePath": "a.md", "path": "/a.html" ... },
27+
]
28+
```
29+
30+
### `$pagination.length`
31+
32+
当前分页的长度。
33+
34+
### `$pagination.hasPrev`
35+
36+
是否存在上一个分页。
37+
38+
### `$pagination.prevLink`
39+
40+
上一个分页的链接。
41+
42+
### `$pagination.hasNext`
43+
44+
是否存在下一个分页。
45+
46+
### `$pagination.nextLink`
47+
48+
下一个分页的链接。
49+
50+
### `$pagination.getSpecificPageLink`
51+
52+
通过页码获取特定的分页页面。
53+
54+
::: tip
55+
你可以使用此功能将分页组件自定义为内部 [`<Pagnination />`](../components/#pagination) 组件。
56+
:::
57+
58+
## $frontmatterKey
59+
60+
如果你按照以下方式创建 [Frontmatter 分类器](../guide/getting-started.md#frontmatter-分类器)
61+
62+
```js
63+
module.exports = {
64+
plugins: [
65+
[
66+
'@vuepress/blog',
67+
{
68+
frontmatters: [
69+
{
70+
// 当前分类的唯一 ID
71+
id: 'tag',
72+
// 决定将 frontmatter 键值归到该类别下
73+
keys: ['tag'],
74+
// `entry page` (或者 `list page`) 的路径
75+
path: '/tag/',
76+
// `entry page` 的布局
77+
layout: 'Tag',
78+
},
79+
],
80+
},
81+
],
82+
],
83+
}
84+
```
85+
86+
那么此插件将向 Vue 原型注入 `$frontmatterKey` 对象, ,因此你可以在自己的布局组件 (`<Tag />`) 上直接使用它。
87+
88+
### `$frontmatterKey.list`
89+
90+
获取一个含有匹配的 frontmatter 分类器类型的列表。
91+
92+
接口如下:
93+
94+
```typescript
95+
type FrontmatterKeyList = Array<{
96+
name: string
97+
path: string
98+
pages: Array<VuePressPage>
99+
}>
100+
```
101+
102+
你可以重新阅读 [Frontmatter 分类器](../guide/getting-started.md#frontmatter-分类器) 来观看 `tag` 的真实示例。
103+
104+
::: tip 多个 Frontmatter 分类器
105+
106+
如果你创建两个 Frontmatter 分类器,例如 `tag``category`,那么在 `/tag/` 路由中,`$frontmatterKey` 自动指向 `tag` ,而在 `/category/` 中,它将指向 `category`
107+
108+
此变量本质上是设计用于概括 frontmatter 键的列表页面。
109+
:::
110+
111+
## $service
112+
113+
### $service.comment
114+
115+
#### `$ service.comment.enabled`
116+
117+
是否启用评论。
118+
119+
#### `$ service.comment.service`
120+
121+
获取评论服务
122+
123+
### $service.email
124+
125+
#### `$service.email.enabled`
126+
127+
是否启用电子邮件(新闻通讯)服务。
128+
129+
### $service.feed
130+
131+
#### `$service.feed.rss`
132+
133+
是否启用 RSS feed。
134+
135+
#### `$service.feed.atom`
136+
137+
是否启用了 Atom feed。
138+
139+
#### `$service.feed.json`
140+
141+
是否启用 JSON feed。

0 commit comments

Comments
 (0)