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

Commit 826a945

Browse files
committed
docs: update
1 parent bff142f commit 826a945

File tree

3 files changed

+180
-8
lines changed

3 files changed

+180
-8
lines changed

docs/.vuepress/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module.exports = {
2-
title: 'vuepress-theme-blogging',
2+
title: '@vuepress/theme-blog',
33
description: 'A blog theme of VuePress'
44
}

docs/README.md

Lines changed: 178 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,190 @@
1-
# vuepress-theme-blogging
1+
---
2+
sidebar: auto
3+
---
24

3-
[![NPM version](https://badgen.net/npm/v/vuepress-theme-blogging)](https://npmjs.com/package/vuepress-theme-blogging) [![NPM downloads](https://badgen.net/npm/dm/vuepress-theme-blogging)](https://npmjs.com/package/vuepress-theme-blogging) [![CircleCI](https://badgen.net/circleci/github/ulivz/vuepress-theme-blogging/master)](https://circleci.com/gh/ulivz/vuepress-theme-blogging/tree/master)
5+
# @vuepress/plugin-blog
6+
7+
> Default blog theme for VuePress
48
59
## Install
610

711
```bash
8-
npm i vuepress-theme-blogging
12+
yarn add @vuepress/theme-blog -D
13+
# OR npm install @vuepress/theme-blog -D
914
```
1015

1116
## Usage
1217

1318
```js
14-
const vuepressThemeBlogging = require('vuepress-theme-blogging')
19+
// .vuepress/config.js
20+
module.exports = {
21+
theme: '@vuepress/blog',
22+
themeConfig: {
23+
// Please keep looking down to see the available options.
24+
}
25+
}
26+
```
27+
28+
## Options
29+
30+
### nav
31+
32+
- 类型: `Array<{ text: string, link: string }>`
33+
- 默认值: `undefined`
1534

16-
vuepressThemeBlogging()
17-
//=> foo
35+
e.g.
36+
37+
```js
38+
module.exports = {
39+
themeConfig: {
40+
nav: [
41+
{
42+
text: 'Home',
43+
link: '/',
44+
},
45+
{
46+
text: 'Archive',
47+
link: '/archive/',
48+
},
49+
{
50+
text: 'Tags',
51+
link: '/tag/',
52+
},
53+
],
54+
},
55+
}
1856
```
57+
58+
### footer
59+
60+
#### footer.contact
61+
62+
63+
- 类型: `Array<{ type: ContactType, link: string }>`
64+
- 默认值: `undefined`
65+
66+
Contact information, displayed on the left side of footer.
67+
68+
```js
69+
module.exports = {
70+
themeConfig: {
71+
footer: {
72+
contact: [
73+
{
74+
type: 'github',
75+
link: 'https://github.com/vuejs/vuepress',
76+
},
77+
{
78+
type: 'twitter',
79+
link: 'https://github.com/vuejs/vuepress',
80+
},
81+
],
82+
},
83+
},
84+
}
85+
```
86+
87+
For now `ContactType` supports following enums:
88+
89+
- github
90+
- facebook
91+
- twitter
92+
93+
::: tip
94+
Welcome contribution of adding more built-in contact type.
95+
:::
96+
97+
#### footer.copyright
98+
99+
Copyright information, displayed on the right side of footer.
100+
101+
```js
102+
module.exports = {
103+
themeConfig: {
104+
footer: {
105+
copyright: [
106+
{
107+
text: 'Privacy Policy',
108+
link: 'https://policies.google.com/privacy?hl=en-US',
109+
},
110+
{
111+
text: 'MIT Licensed | Copyright © 2018-present Vue.js',
112+
link: '',
113+
},
114+
],
115+
},
116+
},
117+
}
118+
```
119+
120+
### modifyBlogPluginOptions
121+
122+
A function used to modify the default blog plugin options. It's common to used it to add custom classifiers. e.g.
123+
124+
```js
125+
module.exports = {
126+
themeConfig: {
127+
modifyBlogPluginOptions(blogPlugnOptions) {
128+
const writingDirectoryClassifier = {
129+
id: 'writing',
130+
dirname: '_writings',
131+
path: '/writings/',
132+
layout: 'IndexWriting',
133+
itemLayout: 'Writing',
134+
itemPermalink: '/writings/:year/:month/:day/:slug',
135+
pagination: {
136+
perPagePosts: 5,
137+
},
138+
}
139+
140+
blogPlugnOptions.directories.push(writingDirectoryClassifier)
141+
return blogPlugnOptions
142+
},
143+
},
144+
}
145+
```
146+
147+
Here is the default blog plugin options:
148+
149+
```js
150+
{
151+
directories: [
152+
{
153+
id: 'post',
154+
dirname: '_posts',
155+
path: '/',
156+
layout: 'IndexPost',
157+
itemLayout: 'Post',
158+
itemPermalink: '/:year/:month/:day/:slug',
159+
pagination: {
160+
perPagePosts: 5,
161+
},
162+
},
163+
{
164+
id: 'archive',
165+
dirname: '_archive',
166+
path: '/archive/',
167+
layout: 'IndexArchive',
168+
itemLayout: 'Post',
169+
itemPermalink: '/archive/:year/:month/:day/:slug',
170+
pagination: {
171+
perPagePosts: 5,
172+
},
173+
},
174+
],
175+
frontmatters: [
176+
{
177+
id: "tag",
178+
keys: ['tag', 'tags'],
179+
path: '/tag/',
180+
layout: 'Tags',
181+
frontmatter: { title: 'Tags' },
182+
itemlayout: 'Tag',
183+
pagination: {
184+
perPagePosts: 5
185+
}
186+
},
187+
]
188+
}
189+
```
190+

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@vuepress/theme-blog",
33
"version": "0.0.0",
4-
"description": "Official blog theme of VuePress",
4+
"description": "Default blog theme for VuePress",
55
"main": "index.js",
66
"files": [
77
"index.js",

0 commit comments

Comments
 (0)