Skip to content

Commit 2014062

Browse files
committed
Merge branch 'master' into feat/refine-theme-api
2 parents 66ede10 + 411af33 commit 2014062

File tree

12 files changed

+41
-127
lines changed

12 files changed

+41
-127
lines changed

Diff for: CHANGELOG.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
* **$core:** support global layout (close: [#1226](https://github.com/vuejs/vuepress/issues/1226)) ([c91f55a](https://github.com/vuejs/vuepress/commit/c91f55a))
2525

26-
From now on, users have the ability to use a custom global layout component via [siteConfig](https://vuepress.vuejs.org/miscellaneous/glossary.html#siteconfig) or [themeEntry](https://vuepress.vuejs.org/miscellaneous/glossary.html#themeentry):
26+
From now on, users have the ability to use a custom global layout component via [siteConfig](https://v1.vuepress.vuejs.org/miscellaneous/glossary.html#siteconfig) or [themeEntryFile](https://v1.vuepress.vuejs.org/miscellaneous/glossary.html#themeentryfile):
2727

2828
```js
2929
module.exports = {
@@ -103,7 +103,7 @@
103103
* **$core:** Cannot load assets when `base` is not '/' (close: [#1238](https://github.com/vuejs/vuepress/issues/1238))([#1239](https://github.com/vuejs/vuepress/issues/1239)) ([8a234bb](https://github.com/vuejs/vuepress/commit/8a234bb))
104104
<br>This is a regression issue of leverage webpack-dev-server at [#1195](https://github.com/vuejs/vuepress/issues/1195).
105105

106-
* **$markdown:** Remove colon as separator for [Import Code Snippets](https://vuepress.vuejs.org/guide/markdown.html#import-code-snippets) (close: [#1151](https://github.com/vuejs/vuepress/issues/1151)) ([#1236](https://github.com/vuejs/vuepress/issues/1236)) ([099d346](https://github.com/vuejs/vuepress/commit/099d346))
106+
* **$markdown:** Remove colon as separator for [Import Code Snippets](https://v1.vuepress.vuejs.org/guide/markdown.html#import-code-snippets) (close: [#1151](https://github.com/vuejs/vuepress/issues/1151)) ([#1236](https://github.com/vuejs/vuepress/issues/1236)) ([099d346](https://github.com/vuejs/vuepress/commit/099d346))
107107

108108

109109
### Features
@@ -129,7 +129,7 @@
129129
### Features
130130

131131
* **$core:** Leverage `webpack-dev-server` and sunset `webpack-serve` ([#1195](https://github.com/vuejs/vuepress/issues/1195)) ([81e3ef6](https://github.com/vuejs/vuepress/commit/81e3ef6))
132-
- Add new plugin option api [beforeDevServer](https://vuepress.vuejs.org/plugin/option-api.html#beforedevserver) and [afterDevServer](https://vuepress.vuejs.org/plugin/option-api.html#afterdevserver).
132+
- Add new plugin option api [beforeDevServer](https://v1.vuepress.vuejs.org/plugin/option-api.html#beforedevserver) and [afterDevServer](https://v1.vuepress.vuejs.org/plugin/option-api.html#afterdevserver).
133133
- Remove `enhanceDevServer`.
134134
- Publish [vuepress-plugin-export](https://github.com/ulivz/vuepress-plugin-export).
135135
* **$core:** Allow a theme package using a sub directory (close [#1204](https://github.com/vuejs/vuepress/issues/1204)) ([#1206](https://github.com/vuejs/vuepress/issues/1206)) ([febe3a7](https://github.com/vuejs/vuepress/commit/febe3a7))
@@ -139,7 +139,7 @@
139139

140140
* **$core:** - Plugin option `enhanceDevServer` was removed.
141141
- **For 0.x users**, there is no any effect since we didn't expose API to modify it.
142-
- **For 1.x users whose version of VuePress is lower than 1.0.0-alpha.33**, you should use [`beforeDevServer`](https://vuepress.vuejs.org/plugin/option-api.html#beforedevserver)(i.e. [before](https://webpack.js.org/configuration/dev-server/#devserver-before) in `webpack-dev-server`) to replace `enhanceDevServer`, you can also use [`afterDevServer`](https://vuepress.vuejs.org/plugin/option-api.html#afterdevserver)(i.e. [after](https://webpack.js.org/configuration/dev-server/#devserver-after) in `webpack-dev-server`) to execute custom middleware after all other middleware internally within the server.
142+
- **For 1.x users whose version of VuePress is lower than 1.0.0-alpha.33**, you should use [`beforeDevServer`](https://v1.vuepress.vuejs.org/plugin/option-api.html#beforedevserver)(i.e. [before](https://webpack.js.org/configuration/dev-server/#devserver-before) in `webpack-dev-server`) to replace `enhanceDevServer`, you can also use [`afterDevServer`](https://v1.vuepress.vuejs.org/plugin/option-api.html#afterdevserver)(i.e. [after](https://webpack.js.org/configuration/dev-server/#devserver-after) in `webpack-dev-server`) to execute custom middleware after all other middleware internally within the server.
143143

144144
<a name="1.0.0-alpha.32"></a>
145145
# [1.0.0-alpha.32](https://github.com/vuejs/vuepress/compare/v1.0.0-alpha.31...v1.0.0-alpha.32) (2019-01-15)
@@ -225,7 +225,7 @@
225225

226226
* **$core:** pass generated page paths to `generated` hook ([#925](https://github.com/vuejs/vuepress/issues/925)) ([5ee2b2b](https://github.com/vuejs/vuepress/commit/5ee2b2b))
227227
* **$core:** `extendCli` Plugin Option API ([#1069](https://github.com/vuejs/vuepress/issues/1069)) ([e963731](https://github.com/vuejs/vuepress/commit/e963731))
228-
- See [docs](https://vuepress.vuejs.org/plugin/option-api.html#extendcli).
228+
- See [docs](https://v1.vuepress.vuejs.org/plugin/option-api.html#extendcli).
229229
* **$plugin-search:** searchable paths with test RegExp ([#1032](https://github.com/vuejs/vuepress/issues/1032)) ([d6bddf1](https://github.com/vuejs/vuepress/commit/d6bddf1))
230230

231231

@@ -621,7 +621,7 @@
621621
### Features
622622

623623
- **Plugin API**
624-
- [Documentation](https://vuepress.vuejs.org/plugin/)
624+
- [Documentation](https://v1.vuepress.vuejs.org/plugin/)
625625
- Multiple official plugins
626626
- [@vuepress/plugin-active-header-links](https://github.com/vuejs/vuepress/tree/master/packages/@vuepress/plugin-active-header-links)
627627
- [@vuepress/plugin-back-to-top](https://github.com/vuejs/vuepress/tree/master/packages/%40vuepress/plugin-back-to-top) (Thanks to @ycmjason )
@@ -636,18 +636,18 @@
636636

637637
- **Refined Theme API**
638638
- From now on, the theme will no longer use Layout.vue as the entry point, but you can have your own configuration. For example, a theme can have some built-in plugins.
639-
- [Documentation](https://vuepress.vuejs.org/theme/)
639+
- [Documentation](https://v1.vuepress.vuejs.org/theme/)
640640

641641
- **Permalinks**
642642
- From now on, VuePress supports custom routing in addition to the default file-level-based routing.
643-
- [Documentation](https://vuepress.vuejs.org/guide/permalinks.html)
643+
- [Documentation](https://v1.vuepress.vuejs.org/guide/permalinks.html)
644644

645645
- **Markdown slots**
646-
- [Documentation](https://vuepress.vuejs.org/guide/markdown-slot.html)
646+
- [Documentation](https://v1.vuepress.vuejs.org/guide/markdown-slot.html)
647647

648648
- **Free to add new pages**
649649
- You can add new pages with content (i.e. pointing to markdown files) or no content (i.e. common routes).
650-
- [Documentation](https://vuepress.vuejs.org/plugin/option-api.html#additionalpages)
650+
- [Documentation](https://v1.vuepress.vuejs.org/plugin/option-api.html#additionalpages)
651651

652652
- **Custom temp path**
653653
- The running of VuePress actually depends on some temporary files generated during the build time. Before that, its default location is in `node_modules`, but now you can start configuring it, but don't forget to add it to gitignore.
@@ -799,7 +799,7 @@
799799
* **$core:**: version data layer ([0c5b752](https://github.com/vuejs/vuepress/commit/0c5b752))
800800
* **$default-theme:** new file-level API: `style.styl`. ([2f53f2f](https://github.com/vuejs/vuepress/commit/2f53f2f))
801801
1. Fixed overriding css variable doesn't work at `0.11.0` (close: [#639](https://github.com/vuejs/vuepress/issues/639))
802-
2. Split `override.styl` into two APIs: `override.styl` and `style.styl`, the former will focus on ONLY the stylus constants override, while the latter will focus on styles override or custom styles. See also: https://vuepress.vuejs.org/default-theme-config/#simple-css-override.
802+
2. Split `override.styl` into two APIs: `override.styl` and `style.styl`, the former will focus on ONLY the stylus constants override, while the latter will focus on styles override or custom styles. See also: https://v1.vuepress.vuejs.org/default-theme-config/#simple-css-override.
803803

804804

805805
<a name="0.11.0"></a>

Diff for: README.md

+5-7
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,24 @@
1212
<a href="https://discordapp.com/invite/HBherRA"><img src="https://img.shields.io/badge/Discord-join%20chat-738bd7.svg" alt="vuepress channel on Discord"></a>
1313
</p>
1414

15-
> This is the branch for `VuePress Next` and docs are available at https://vuepress.vuejs.org.
15+
> This is the branch for `VuePress 1.x` and docs are available at https://v1.vuepress.vuejs.org.
1616
1717
## Status: alpha
1818

1919
Certain combinations of plugins may not work properly, and things may change or break until we reach `beta` phase. Do not use in production yet unless you are adventurous.
2020

21-
For 0.x, it's moved to [0.x branch](https://github.com/vuejs/vuepress/tree/0.x) and still maintained, the website was switching to https://v0.vuepress.vuejs.org.
22-
23-
> Note that we are working hard to improve the documentation and contributions welcome if you keep up with the latest changes.
21+
For 0.x, it's moved to [0.x branch](https://github.com/vuejs/vuepress/tree/0.x) and still maintained, the website is: https://vuepress.vuejs.org.
2422

2523
## Install
2624

2725
```bash
28-
yarn add vuepress -D # Install 0.x.x.
29-
yarn add vuepress@next -D # Install next.
26+
yarn add vuepress -D # Install 0.x
27+
yarn add vuepress@next -D # Install 1.x.
3028
```
3129

3230
## Showcase
3331

34-
Check out [Awesome Vuepress](https://github.com/ulivz/awesome-vuepress) to find awesome things related to VuePress.
32+
Check out [Awesome Vuepress](https://github.com/ulivz/awesome-vuepress) to find awesome things related to VuePress 1.x .
3533

3634
## Development
3735

Diff for: packages/@vuepress/core/lib/app/redirect.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,5 @@ export function handleRedirectForCleanUrls (router) {
5050
}
5151

5252
function isRouteExists (router, path) {
53-
return router.options.routes.filter(route => route.path === path).length > 0
53+
return router.options.routes.filter(route => route.path.toLowerCase() === path.toLowerCase()).length > 0
5454
}

Diff for: packages/@vuepress/markdown-loader/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ module.exports = function (src) {
2121
const isProd = process.env.NODE_ENV === 'production'
2222
const isServer = this.target === 'node'
2323
const options = getOptions(this)
24+
const loader = Object.create(this)
2425
const { sourceDir } = options
2526
let { markdown } = options
2627
if (!markdown) {
@@ -71,6 +72,7 @@ module.exports = function (src) {
7172
data: { hoistedTags, links },
7273
dataBlockString
7374
} = markdown.render(content, {
75+
loader,
7476
frontmatter: frontmatter.data,
7577
relPath: path.relative(sourceDir, file)
7678
})

Diff for: packages/@vuepress/markdown/lib/link.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ module.exports = (md, externalAttrs) => {
6666
const routerLinks = md.$data.routerLinks || (md.$data.routerLinks = [])
6767
routerLinks.push(to)
6868

69-
return Object.assign({}, token, {
70-
tag: 'router-link'
69+
return Object.create(token, {
70+
tag: { value: 'router-link' }
7171
})
7272
}
7373

Diff for: packages/@vuepress/theme-default/components/Home.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
<img
55
v-if="data.heroImage"
66
:src="$withBase(data.heroImage)"
7-
alt="hero"
7+
:alt="data.heroAlt || 'hero'"
88
>
99

10-
<h1 id="main-title">{{ data.heroText || $title || 'Hello' }}</h1>
10+
<h1 v-if="data.heroText !== null" id="main-title">{{ data.heroText || $title || 'Hello' }}</h1>
1111

1212
<p class="description">
1313
{{ data.tagline || $description || 'Welcome to your VuePress site' }}

Diff for: packages/docs/docs/.vuepress/config.js

+7-11
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
const path = require('path')
21
const container = require('markdown-it-container')
32

43
module.exports = ctx => ({
54
dest: '../../vuepress',
65
locales: {
76
'/': {
87
lang: 'en-US',
9-
title: 'VuePress',
8+
title: 'VuePress 1.x',
109
description: 'Vue-powered Static Site Generator'
1110
},
1211
'/zh/': {
1312
lang: 'zh-CN',
14-
title: 'VuePress',
13+
title: 'VuePress 1.x',
1514
description: 'Vue 驱动的静态网站生成器'
1615
}
1716
},
@@ -32,10 +31,10 @@ module.exports = ctx => ({
3231
editLinks: true,
3332
docsDir: 'packages/docs/docs',
3433
// #697 Provided by the official algolia team.
35-
algolia: ctx.isProd ? ({
36-
apiKey: '3a539aab83105f01761a137c61004d85',
37-
indexName: 'vuepress'
38-
}) : null,
34+
// algolia: ctx.isProd ? ({
35+
// apiKey: '3a539aab83105f01761a137c61004d85',
36+
// indexName: 'vuepress'
37+
// }) : null,
3938
locales: {
4039
'/': {
4140
label: 'English',
@@ -64,7 +63,7 @@ module.exports = ctx => ({
6463
}
6564
},
6665
plugins: [
67-
['@vuepress/i18n-ui',!ctx.isProd],
66+
['@vuepress/i18n-ui', !ctx.isProd],
6867
['@vuepress/back-to-top', true],
6968
['@vuepress/pwa', {
7069
serviceWorker: true,
@@ -76,9 +75,6 @@ module.exports = ctx => ({
7675
ga: 'UA-128189152-1'
7776
}],
7877
],
79-
clientRootMixin: ctx.isProd
80-
? path.resolve(__dirname, 'mixin.js')
81-
: [],
8278
extendMarkdown (md) {
8379
md.use(container, 'upgrade', {
8480
render: (tokens, idx) => tokens[idx].nesting === 1

Diff for: packages/docs/docs/.vuepress/mixin.js

-63
This file was deleted.

Diff for: packages/docs/docs/.vuepress/nav/en.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,9 @@ module.exports = [
4949
]
5050
}
5151
]
52-
}
52+
},
53+
{
54+
text: '0.x',
55+
link: 'https://vuepress.vuejs.org/'
56+
},
5357
]

Diff for: packages/docs/docs/.vuepress/nav/zh.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,9 @@ module.exports = [
4949
]
5050
}
5151
]
52-
}
52+
},
53+
{
54+
text: '0.x',
55+
link: 'https://vuepress.vuejs.org/'
56+
},
5357
]

Diff for: packages/docs/docs/.vuepress/styles/index.styl

-27
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,5 @@
44
// font-size 30px;
55
//}
66

7-
.toasted-container.compatibility-notification
8-
&.top-right
9-
right 4vw
10-
.toasted
11-
font-weight 400
12-
width 400px
13-
background-color $accentColor
14-
padding 20px 20px
15-
line-height 1.5
16-
display block
17-
box-shadow 0 4px 5px 0 rgba(0,0,0,0.14), 0 1px 10px 0 rgba(0,0,0,0.12), 0 2px 4px -1px rgba(0,0,0,0.3)
18-
.action.ripple
19-
border 1px solid #fff
20-
color #fff
21-
float right
22-
white-space nowrap
23-
margin 0
24-
code
25-
text-decoration underline
26-
27-
@media (max-width: $MQMobile)
28-
.toasted-container.compatibility-notification
29-
&.top-right
30-
right 5vw
31-
.toasted
32-
width 80vw
33-
347

358

Diff for: packages/docs/docs/zh/theme/default-theme-config.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ module.exports = {
178178
sidebar: [
179179
{
180180
title: 'Group 1', // 必要的
181-
path: '/foo/' // 可选的, 应该是一个绝对路径
181+
path: '/foo/', // 可选的, 应该是一个绝对路径
182182
collapsable: false, // 可选的, 默认值是 true,
183183
sidebarDepth: 1, // 可选的, 默认值是 1
184184
children: [

0 commit comments

Comments
 (0)