Skip to content

Commit c72bf9d

Browse files
committed
Merge branch 'master' into add-plugin-config
2 parents 9f5635a + 8741a71 commit c72bf9d

29 files changed

+725
-126
lines changed

CHANGELOG.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,69 @@
1+
<a name="0.8.3"></a>
2+
## [0.8.3](https://github.com/vuejs/vuepress/compare/v0.8.2...v0.8.3) (2018-04-23)
3+
4+
5+
### Bug Fixes
6+
7+
* always write override.style ([9861deb](https://github.com/vuejs/vuepress/commit/9861deb))
8+
9+
10+
11+
<a name="0.8.2"></a>
12+
## [0.8.2](https://github.com/vuejs/vuepress/compare/v0.8.1...v0.8.2) (2018-04-23)
13+
14+
15+
### Bug Fixes
16+
17+
* nav-item underline use $accentColor ([#230](https://github.com/vuejs/vuepress/issues/230)) ([ddb590d](https://github.com/vuejs/vuepress/commit/ddb590d))
18+
19+
20+
### Features
21+
22+
* expose layout slots for injecting custom content ([3814e88](https://github.com/vuejs/vuepress/commit/3814e88))
23+
24+
25+
26+
<a name="0.8.1"></a>
27+
## [0.8.1](https://github.com/vuejs/vuepress/compare/v0.8.0...v0.8.1) (2018-04-23)
28+
29+
30+
### Bug Fixes
31+
32+
* algolia regression (close [#228](https://github.com/vuejs/vuepress/issues/228)) ([44b1201](https://github.com/vuejs/vuepress/commit/44b1201))
33+
34+
35+
36+
<a name="0.8.0"></a>
37+
# [0.8.0](https://github.com/vuejs/vuepress/compare/v0.7.1...v0.8.0) (2018-04-23)
38+
39+
40+
### Bug Fixes
41+
42+
* algolia check should be checking themeConfig.algolia ([504c21d](https://github.com/vuejs/vuepress/commit/504c21d))
43+
* default to localhost on windows (close [#221](https://github.com/vuejs/vuepress/issues/221)) ([4d5c50e](https://github.com/vuejs/vuepress/commit/4d5c50e))
44+
* fix emoji not showing on sidebars ([#206](https://github.com/vuejs/vuepress/issues/206)) ([bc2c83a](https://github.com/vuejs/vuepress/commit/bc2c83a))
45+
* fix Sidebar link active logic ([#215](https://github.com/vuejs/vuepress/issues/215)) ([9c93d8f](https://github.com/vuejs/vuepress/commit/9c93d8f))
46+
* Fix the style of repo link. ([f55fa00](https://github.com/vuejs/vuepress/commit/f55fa00))
47+
* fix title inferrence regression (close [#208](https://github.com/vuejs/vuepress/issues/208)) ([52c20cf](https://github.com/vuejs/vuepress/commit/52c20cf))
48+
* renames index.js to enhanceApp.js ([#226](https://github.com/vuejs/vuepress/issues/226)) ([0170449](https://github.com/vuejs/vuepress/commit/0170449))
49+
* siteTitle vs pageTitle ([cd9b788](https://github.com/vuejs/vuepress/commit/cd9b788))
50+
51+
52+
### Features
53+
54+
* Add docsRepo ([#155](https://github.com/vuejs/vuepress/issues/155)) ([716aefe](https://github.com/vuejs/vuepress/commit/716aefe))
55+
* add max search suggestions config ([#163](https://github.com/vuejs/vuepress/issues/163)) ([a16a5b4](https://github.com/vuejs/vuepress/commit/a16a5b4))
56+
* Algolia DocSearch Integration ([#201](https://github.com/vuejs/vuepress/issues/201)) ([2f0da01](https://github.com/vuejs/vuepress/commit/2f0da01))
57+
* also expose siteData in enhanceApp.js ([5157c6f](https://github.com/vuejs/vuepress/commit/5157c6f))
58+
* expose all css pre-processor's options. (close [#169](https://github.com/vuejs/vuepress/issues/169)) ([#178](https://github.com/vuejs/vuepress/issues/178)) ([8f0755a](https://github.com/vuejs/vuepress/commit/8f0755a))
59+
* support built-in pug config and document using pro-processors at component ([#151](https://github.com/vuejs/vuepress/issues/151)) ([f322105](https://github.com/vuejs/vuepress/commit/f322105))
60+
* support excerpt extraction with `<!-- more -->` (close [#174](https://github.com/vuejs/vuepress/issues/174)) ([fa404dc](https://github.com/vuejs/vuepress/commit/fa404dc))
61+
* support for TOML front matter ([#141](https://github.com/vuejs/vuepress/issues/141)) ([#164](https://github.com/vuejs/vuepress/issues/164)) ([70620ba](https://github.com/vuejs/vuepress/commit/70620ba))
62+
* support toml config ([#138](https://github.com/vuejs/vuepress/issues/138)) ([d136e22](https://github.com/vuejs/vuepress/commit/d136e22))
63+
* theme index enhancment support ([#154](https://github.com/vuejs/vuepress/issues/154)) ([d026801](https://github.com/vuejs/vuepress/commit/d026801))
64+
65+
66+
167
<a name="0.7.1"></a>
268
## [0.7.1](https://github.com/vuejs/vuepress/compare/v0.7.0...v0.7.1) (2018-04-20)
369

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ https://vuepress.vuejs.org/
2929

3030
VuePress is still a work in progress. There are a few things that it currently does not support but are planned:
3131

32-
- Algolia DocSearch Integration
3332
- Blogging support
3433

3534
Contributions are welcome!

docs/.vuepress/config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ module.exports = {
2424
['meta', { name: 'msapplication-TileColor', content: '#000000' }]
2525
],
2626
serviceWorker: true,
27+
theme: 'vue',
2728
themeConfig: {
2829
repo: 'vuejs/vuepress',
2930
editLinks: true,

docs/default-theme-config/README.md

Lines changed: 51 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ Any additional content after the `YAML front matter` will be parsed as normal ma
3333

3434
If you want to use a completely custom homepage layout, you can also use a [Custom Layout](#custom-layout-for-specific-pages).
3535

36-
## Navbar Links
36+
## Navbar
37+
38+
The Navbar may contain yourg page title, [Search Box](#search-box), [Navbar Links](#navbar-links), [Languages](../guide/i18n.md) and [Repository Link](#git-repo-and-edit-links), all of them depends on your configuration.
39+
40+
### Navbar Links
3741

3842
You can add links to the navbar via `themeConfig.nav`:
3943

@@ -86,6 +90,16 @@ module.exports = {
8690
}
8791
```
8892

93+
### Disable the Navbar
94+
95+
You can disable the navbar for a specific page via `YAML front matter`:
96+
97+
``` yaml
98+
---
99+
navbar: false
100+
---
101+
```
102+
89103
## Sidebar
90104

91105
To enable the sidebar, use `themeConfig.sidebar`. The basic configuration expects an Array of links:
@@ -199,8 +213,6 @@ Make sure to define the fallback configuration last.
199213
VuePress checks each sidebar config from top to bottom. If the fallback configuration was first, VuePress would incorrectly match `/foo/` or `/bar/four.html` because they both start with `/`.
200214
:::
201215

202-
203-
204216
### Auto Sidebar for Single Pages
205217

206218
If you wish to automatically generate a sidebar that contains only the header links for the current page, you can use `YAML front matter` on that page:
@@ -221,6 +233,38 @@ sidebar: false
221233
---
222234
```
223235

236+
## Search Box
237+
238+
### Built-in Search
239+
240+
You can disable the built-in search box with `themeConfig.search: false`, and customize how many suggestions to be shown with `themeConfig.searchMaxSuggestions`:
241+
242+
``` js
243+
module.exports = {
244+
themeConfig: {
245+
search: false,
246+
searchMaxSuggestions: 10
247+
}
248+
}
249+
```
250+
251+
### Algolia Search
252+
253+
The `themeConfig.algolia` option allows you to use [Algolia DocSearch](https://community.algolia.com/docsearch/) to replace the simple built-in search. To enable it, you need to provide at least `apiKey` and `indexName`:
254+
255+
```js
256+
module.exports = {
257+
themeConfig: {
258+
algolia: {
259+
apiKey: '<API_KEY>',
260+
indexName: '<INDEX_NAME>'
261+
}
262+
}
263+
}
264+
```
265+
266+
For more options, refer to [Algolia DocSearch's documentation](https://github.com/algolia/docsearch#docsearch-options).
267+
224268
## Prev / Next Links
225269

226270
Prev and next links are automatically inferred based on the sidebar order of the active page. You can also explicitly overwrite or disable them using `YAML front matter`:
@@ -245,9 +289,9 @@ module.exports = {
245289
// Customising the header label
246290
// Defaults to "GitHub"/"GitLab"/"Bitbucket" depending on `themeConfig.repo`
247291
repoLabel: 'Contribute!',
248-
292+
249293
// Optional options for generating "Edit this page" link
250-
294+
251295
// if your docs are in a different repo from your main project:
252296
docsRepo: 'vuejs/vuepress',
253297
// if your docs are not at the root of the repo:
@@ -289,6 +333,8 @@ pageClass: custom-page-class
289333
Then you can write CSS targeting that page only:
290334

291335
``` css
336+
/* .vuepress/override.styl */
337+
292338
.theme-container.custom-page-class {
293339
/* page-specific rules */
294340
}

docs/guide/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ Each markdown file is compiled into HTML with [markdown-it](https://github.com/m
3131

3232
VuePress is still a work in progress. There are a few things that it currently does not support but are planned:
3333

34-
- Algolia DocSearch Integration
3534
- Blogging support
3635

3736
Contributions are welcome!

docs/guide/basic-config.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ If you've got the dev server running, you should see the page now has a header w
1717

1818
Consult the [Config Reference](../config/) for a full list of options.
1919

20+
::: tip Alternative Config Formats
21+
You can also use YAML (`.vuepress/config.yml`) or TOML (`.vuepress/config.toml`) formats for the configuration file.
22+
:::
23+
2024
## Theme Configuration
2125

2226
A VuePress theme is responsible for all the layout and interactivity details of your site. VuePress ships with a default theme (you are looking at it right now) which is designed for technical documentation. It exposes a number of options that allow you to customize the navbar, sidebar and homepage, etc. For details, check out the [Default Theme Config](../default-theme-config/) page.
@@ -31,7 +35,8 @@ Since the VuePress app is a standard Vue app, you can apply app-level enhancemen
3135
export default ({
3236
Vue, // the version of Vue being used in the VuePress app
3337
options, // the options for the root Vue instance
34-
router // the router instance for the app
38+
router, // the router instance for the app
39+
siteData // site metadata
3540
}) => {
3641
// ...apply enhancements to the app
3742
}

docs/guide/custom-themes.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,16 @@ The compiled content of the current `.md` file being rendered will be available
7070
</template>
7171
```
7272

73-
## Theme Level Enhancements
73+
## App Level Enhancements
7474

75-
Themes can extend the Vue app that VuePress uses by exposing an `index.js` file at the root of the theme. The file should `export default` a hook function which will receive an object containing some app level values. You can use this hook to install additional Vue plugins, register global components, or add additional router hooks:
75+
Themes can enhance the Vue app that VuePress uses by exposing an `enhanceApp.js` file at the root of the theme. The file should `export default` a hook function which will receive an object containing some app level values. You can use this hook to install additional Vue plugins, register global components, or add additional router hooks:
7676

7777
``` js
7878
export default ({
7979
Vue, // the version of Vue being used in the VuePress app
8080
options, // the options for the root Vue instance
81-
router // the router instance for the app
81+
router, // the router instance for the app
82+
siteData // site metadata
8283
}) => {
8384
// ...apply enhancements to the app
8485
}

docs/guide/deploy.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ The following guides are based on a few shared assumptions:
2424

2525
2. Inside your project, create `deploy.sh` with the following content (with highlighted lines uncommented appropriately) and run it to deploy:
2626

27-
::: tip
28-
You can also run this script in your CI setup to enable automatic deployment on each push.
29-
:::
30-
3127
``` bash{13,20,23}
3228
#!/usr/bin/env sh
3329
@@ -56,17 +52,21 @@ git commit -m 'deploy'
5652
cd -
5753
```
5854

55+
::: tip
56+
You can also run the above script in your CI setup to enable automatic deployment on each push.
57+
:::
58+
5959
## GitLab Pages and GitLab CI
6060

61-
1. Set correct `base` in `docs/.vuepress/config.js`.
61+
1. Set correct `base` in `docs/.vuepress/config.js`.
6262

6363
If you are deploying to `https://<USERNAME or GROUP>.gitlab.io/`, you can omit `base` as it defaults to `"/"`.
6464

6565
If your are deploying to `https://<USERNAME or GROUP>.gitlab.io/<REPO>/`, (i.e. your repository is at `https://gitlab.com/<USERNAME>/REPO>`), set `base` to `"/<REPO>/"`.
66-
66+
6767
2. Set `dest` in `.vuepress/config.js` to `public`.
6868

69-
3. Create a file called `.gitlab-ci.yml` in the root of your project with the content below. This will build and deploy your site whenever you make changes to your content.
69+
3. Create a file called `.gitlab-ci.yml` in the root of your project with the content below. This will build and deploy your site whenever you make changes to your content.
7070

7171
```
7272
image: node:9.11.1
@@ -85,7 +85,7 @@ pages:
8585
only:
8686
- master
8787
```
88-
88+
8989

9090
## Netlify
9191

docs/guide/i18n.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ module.exports = {
5656
label: 'English',
5757
// text for the edit-on-github link
5858
editLinkText: 'Edit this page on GitHub',
59+
// algolia docsearch options for current locale
60+
algolia: {},
5961
nav: [
6062
{ text: 'Nested', link: '/nested/' }
6163
],
@@ -71,6 +73,7 @@ module.exports = {
7173
nav: [
7274
{ text: '嵌套', link: '/zh/nested/' }
7375
],
76+
algolia: {},
7477
sidebar: {
7578
'/zh/': [/* ... */],
7679
'/zh/nested/': [/* ... */]

docs/guide/markdown.md

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
---
2-
meta:
3-
- name: keywords
4-
content: static docs generator vue
5-
---
6-
71
# Markdown Extensions
82

93
## Header Anchors
@@ -19,15 +13,7 @@ Inbound links ending in `.md` or `.html` are converted to `<router-link>` for SP
1913
Each sub-directory in your static site should contain a `README.md`. It will automatically be converted to `index.html`.
2014

2115
::: tip
22-
When writing the relative path to a directory's `index.html`, don't forget to close it off with a `/`, otherwise you will get a 404.
23-
24-
```md
25-
<!-- You'll get a 404 -->
26-
[About Page](/about)
27-
28-
<!-- This is correct -->
29-
[About Page](/about/)
30-
```
16+
When writing the relative path to a directory's `index.html`, don't forget to close it off with a `/`, otherwise you will get a 404. For example, use `/config/` instead of `/config`.
3117
:::
3218

3319
If you want to link to another markdown file within a directory, remember to:
@@ -62,12 +48,12 @@ Given the following directory structure:
6248

6349
### External Links
6450

65-
- Outbound links automatically gets `target="_blank"`:
51+
Outbound links automatically gets `target="_blank"`:
6652

67-
- [vuejs.org](https://vuejs.org)
68-
- [VuePress on GitHub](https://github.com/vuejs/vuepress)
53+
- [vuejs.org](https://vuejs.org)
54+
- [VuePress on GitHub](https://github.com/vuejs/vuepress)
6955

70-
## YAML Front Matter
56+
## Front Matter
7157

7258
[YAML front matter](https://jekyllrb.com/docs/frontmatter/) is supported out of the box:
7359

@@ -92,6 +78,30 @@ meta:
9278
---
9379
```
9480

81+
### Alternative Front Matter Formats
82+
83+
In addition, VuePress also supports JSON or [TOML](https://github.com/toml-lang/toml) front matter.
84+
85+
JSON front matter needs to start and end in curly braces:
86+
87+
```
88+
---
89+
{
90+
"title": "Blogging Like a Hacker",
91+
"lang": "en-US"
92+
}
93+
---
94+
```
95+
96+
TOML front matter needs to be explicitly marked as TOML:
97+
98+
```
99+
---toml
100+
title = "Blogging Like a Hacker"
101+
lang = "en-US"
102+
---
103+
```
104+
95105
## GitHub-Style Tables
96106

97107
**Input**

0 commit comments

Comments
 (0)