File tree 3 files changed +82
-2
lines changed
3 files changed +82
-2
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ deploy:
82
82
branch : master
83
83
` ` `
84
84
85
- ## GitLab Pages and GitLab CI
85
+ ### GitLab Pages and GitLab CI
86
86
87
87
1. Set correct ` base` in `docs/.vuepress/config.js`.
88
88
Original file line number Diff line number Diff line change 56
56
你可以在你的持续集成的设置中,设置在每次 push 代码时自动运行上述脚本。
57
57
:::
58
58
59
- ## GitLab Pages and GitLab CI
59
+ ### Github Pages and Travis CI
60
+
61
+ 1 . 在 ` docs/.vuepress/config.js ` 中设置正确的 ` base ` 。
62
+
63
+ 如果你打算发布到 ` https://<USERNAME or GROUP>.github.io/ ` ,则可以省略这一步,因为 ` base ` 默认即是 ` "/" ` 。
64
+
65
+ 如果你打算发布到 ` https://<USERNAME or GROUP>.github.io/<REPO>/ ` (也就是说你的仓库在 ` https://github.com/<USERNAME>/<REPO> ` ),则将 ` base ` 设置为 ` "/<REPO>/" ` 。
66
+
67
+ 2 . 在项目的根目录创建一个名为 ` .travis.yml ` 的文件;
68
+ 3 . 使用 Github Pages 部署提供程序模板并遵循 [ Travis 文档] (https://docs.travis ci.com/user/deployment/pages/)。
69
+
70
+ ``` yaml
71
+ language : node_js
72
+ script :
73
+ - npm run docs:build
74
+ deploy :
75
+ provider : pages
76
+ skip-cleanup : true
77
+ local_dir : docs/.vuepress/dist
78
+ github-token : $GITHUB_TOKEN # a token generated on github allowing travis to push code on you repository
79
+ keep-history : true
80
+ on :
81
+ branch : master
82
+ ` ` `
83
+
84
+ ### GitLab Pages and GitLab CI
60
85
61
86
1. 在 ` docs/.vuepress/config.js` 中设置正确的 `base`。
62
87
Original file line number Diff line number Diff line change @@ -160,6 +160,61 @@ Danger zone, do not proceed
160
160
Danger zone, do not proceed
161
161
:::
162
162
163
+ ## 代码块中的语法高亮
164
+
165
+ VuePress 使用了 [ Prism] ( https://prismjs.com/ ) 来为 markdown 中的代码块实现语法高亮。Prism 支持大量的编程语言,你需要做的只是在代码块的开始倒勾中附加一个有效的语言别名:
166
+
167
+ ** Input**
168
+
169
+ ````
170
+ ``` js
171
+ export default {
172
+ name: 'MyComponent',
173
+ // ...
174
+ }
175
+ ```
176
+ ````
177
+
178
+ ** Output**
179
+
180
+ ``` js
181
+ export default {
182
+ name: ' MyComponent' ,
183
+ // ...
184
+ }
185
+ ```
186
+
187
+ ** Input**
188
+
189
+ ````
190
+ ``` html
191
+ <ul>
192
+ <li
193
+ v-for="todo in todos"
194
+ :key="todo.id"
195
+ >
196
+ {{ todo.text }}
197
+ </li>
198
+ </ul>
199
+ ```
200
+ ````
201
+
202
+ ** Output**
203
+
204
+ ``` html
205
+ <ul >
206
+ <li
207
+ v-for =" todo in todos"
208
+ :key =" todo.id"
209
+ >
210
+ {{ todo.text }}
211
+ </li >
212
+ </ul >
213
+ ```
214
+
215
+ 在 Prism 的网站上查看 [ 合法的语言列表] ( https://prismjs.com/#languages-list ) 。
216
+
217
+
163
218
## 代码块中的行高亮
164
219
165
220
** Input**
You can’t perform that action at this time.
0 commit comments