This project is sponsored by
-
+
export default function () {
// ..
diff --git a/test/markdown/fragments/code-snippet-with-space-in-path.md b/test/markdown/fragments/code-snippet-with-space-in-path.md
new file mode 100644
index 0000000000..57351aadbf
--- /dev/null
+++ b/test/markdown/fragments/code-snippet-with-space-in-path.md
@@ -0,0 +1 @@
+<<< @/test/markdown/fragments/snippet with spaces.js {1}
diff --git a/test/markdown/fragments/snippet with spaces.js b/test/markdown/fragments/snippet with spaces.js
new file mode 100644
index 0000000000..575039d1ec
--- /dev/null
+++ b/test/markdown/fragments/snippet with spaces.js
@@ -0,0 +1,3 @@
+export default function () {
+ // ..
+}
diff --git a/test/markdown/snippet.spec.js b/test/markdown/snippet.spec.js
index 0131132916..e99ed956ad 100644
--- a/test/markdown/snippet.spec.js
+++ b/test/markdown/snippet.spec.js
@@ -23,4 +23,10 @@ describe('snippet', () => {
const output = mdH.render(input)
expect(output).toMatchSnapshot()
})
+
+ test('import snipets when the file has a space in the file path', async () => {
+ const input = await getFragment('code-snippet-with-space-in-path')
+ const output = mdH.render(input)
+ expect(output).toMatchSnapshot()
+ })
})
From 09f53469eaaae527bcaf18e40d01b5d7bc42962e Mon Sep 17 00:00:00 2001
From: Siddhartha Crypto <33014953+siddhartha-crypto@users.noreply.github.com>
Date: Sat, 6 Apr 2019 08:57:57 -0800
Subject: [PATCH 34/48] docs: add information about absolute paths for
`.vuepress/public` dir (#1511)
---
docs/guide/assets.md | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/docs/guide/assets.md b/docs/guide/assets.md
index 04a6eb31fe..c458a03754 100644
--- a/docs/guide/assets.md
+++ b/docs/guide/assets.md
@@ -35,6 +35,15 @@ module.exports = {
Sometimes you may need to provide static assets that are not directly referenced in any of your markdown or theme components - for example, favicons and PWA icons. In such cases you can put them inside `.vuepress/public` and they will be copied to the root of the generated directory.
+Always use absolute paths when calling assets from the `.vuepress/public` directory:
+
+```css
+@font-face {
+ font-family: 'Roboto';
+ src: url('http://github.com/Roboto-Regular.woff2') format('woff2');
+}
+```
+
## Base URL
If your site is deployed to a non-root URL, you will need to set the `base` option in `.vuepress/config.js`. For example, if you plan to deploy your site to `https://foo.github.io/bar/`, then `base` should be set to `"/bar/"` (it should always start and end with a slash).
From aaf4a7bca073aa50e8da110a06baef2030a396c9 Mon Sep 17 00:00:00 2001
From: EGOIST <0x142857@gmail.com>
Date: Sat, 13 Apr 2019 23:49:13 +0800
Subject: [PATCH 35/48] fix($core): unexpected webpack externals (close: #451)
(#1539)
---
lib/webpack/createServerConfig.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/webpack/createServerConfig.js b/lib/webpack/createServerConfig.js
index e9f098354b..f0f05092d8 100644
--- a/lib/webpack/createServerConfig.js
+++ b/lib/webpack/createServerConfig.js
@@ -11,7 +11,7 @@ module.exports = function createServerConfig (options, cliOptions) {
config
.target('node')
- .externals([/^vue|vue-router$/])
+ .externals([/^(vue|vue-router)$/])
.devtool('source-map')
// no need to minimize server build
From 6897b421b5d3ce0e07a2942ad961adb2f0401271 Mon Sep 17 00:00:00 2001
From: ULIVZ <472590061@qq.com>
Date: Sat, 13 Apr 2019 23:53:40 +0800
Subject: [PATCH 36/48] 0.14.11
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 6c60917474..26571fc032 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "vuepress",
- "version": "0.14.10",
+ "version": "0.14.11",
"description": "Minimalistic doc generator with Vue component based layout system",
"main": "lib/index.js",
"bin": {
From 15377f6c7460dc8459c388d7f56b0b494a8ad4b9 Mon Sep 17 00:00:00 2001
From: ULIVZ <472590061@qq.com>
Date: Sat, 13 Apr 2019 23:53:43 +0800
Subject: [PATCH 37/48] chore: changelog
---
CHANGELOG.md | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index cc86b1be1e..229de1874b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,15 @@
+
+## [0.14.11](https://github.com/vuejs/vuepress/compare/v0.14.10...v0.14.11) (2019-04-13)
+
+
+### Bug Fixes
+
+* **$core:** unexpected webpack externals (close: [#451](https://github.com/vuejs/vuepress/issues/451)) ([#1539](https://github.com/vuejs/vuepress/issues/1539)) ([aaf4a7b](https://github.com/vuejs/vuepress/commit/aaf4a7b))
+* **$markdown:** code snippets should not split path on space (close: [#1505](https://github.com/vuejs/vuepress/issues/1505))([#1509](https://github.com/vuejs/vuepress/issues/1509)) ([7b4c4b0](https://github.com/vuejs/vuepress/commit/7b4c4b0))
+* **$theme-default:** hero image resizing ([#873](https://github.com/vuejs/vuepress/issues/873)) ([3cc805d](https://github.com/vuejs/vuepress/commit/3cc805d))
+
+
+
## [0.14.10](https://github.com/vuejs/vuepress/compare/v0.14.9...v0.14.10) (2019-03-02)
From ab5814d66b35f9a97a107aa30b3d3b4b382ea47d Mon Sep 17 00:00:00 2001
From: Charles Villard
Date: Sun, 14 Apr 2019 13:44:08 -0400
Subject: [PATCH 38/48] docs: add CSS preprocessor tip to Build Pipeline
section (#1522)
---
docs/config/README.md | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/docs/config/README.md b/docs/config/README.md
index 1899496557..096f5c6e1f 100644
--- a/docs/config/README.md
+++ b/docs/config/README.md
@@ -199,6 +199,10 @@ module.exports = {
## Build Pipeline
+:::tip Configuring CSS Pre-processors
+VuePress comes with built-in webpack config for the CSS pre-processors listed below. For more information on installation these or pre-processors without built-in support, see [Using Pre-Processors](../guide/using-vue.md#using-pre-processors) for more information.
+:::
+
### postcss
- Type: `Object`
From 6e4d8f475862f57486e906e812efa1545b629c90 Mon Sep 17 00:00:00 2001
From: Ed Bailey
Date: Wed, 1 May 2019 06:30:50 +0100
Subject: [PATCH 39/48] docs: correct the link for 0.x slugify source (#1571)
---
docs/config/README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/config/README.md b/docs/config/README.md
index 096f5c6e1f..403deb186c 100644
--- a/docs/config/README.md
+++ b/docs/config/README.md
@@ -154,7 +154,7 @@ Whether to show line numbers to the left of each code blocks.
### markdown.slugify
- Type: `Function`
-- Default: [source](https://github.com/vuejs/vuepress/blob/master/lib/markdown/slugify.js)
+- Default: [source](https://github.com/vuejs/vuepress/blob/0.x/lib/markdown/slugify.js)
Function for transforming header texts into slugs. This affects the ids/links generated for header anchors, table of contents and sidebar links.
From 3852645fa508043b9b80c913da9660959e990ab0 Mon Sep 17 00:00:00 2001
From: Evan You
Date: Wed, 8 May 2019 09:00:31 +0800
Subject: [PATCH 40/48] chore: update sponsor link
---
docs/.vuepress/components/Bit.vue | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/.vuepress/components/Bit.vue b/docs/.vuepress/components/Bit.vue
index 51d4048aba..0f3d562117 100644
--- a/docs/.vuepress/components/Bit.vue
+++ b/docs/.vuepress/components/Bit.vue
@@ -1,6 +1,6 @@
-
+
This project is sponsored by
From 27d715f3915a3e442e7086c237373a01c44a791a Mon Sep 17 00:00:00 2001
From: Brad Snyder
Date: Sat, 11 May 2019 13:16:11 -0400
Subject: [PATCH 41/48] docs: removed sentence-ending preposition. (#1587)
It wasn't needed anyway.
---
docs/guide/basic-config.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/guide/basic-config.md b/docs/guide/basic-config.md
index e333472466..cbf03ca18c 100644
--- a/docs/guide/basic-config.md
+++ b/docs/guide/basic-config.md
@@ -2,7 +2,7 @@
## Config File
-Without any configuration, the page is pretty minimal, and the user has no way to navigate around the site. To customize your site, let's first create a `.vuepress` directory inside your docs directory. This is where all VuePress-specific files will be placed in. Your project structure is probably like this:
+Without any configuration, the page is pretty minimal, and the user has no way to navigate around the site. To customize your site, let's first create a `.vuepress` directory inside your docs directory. This is where all VuePress-specific files will be placed. Your project structure is probably like this:
```
.
From b18d066797024ddf2b3d6c57ce5baa2bee48f74f Mon Sep 17 00:00:00 2001
From: Philip
Date: Wed, 29 May 2019 18:34:04 +0200
Subject: [PATCH 42/48] docs: clarify where to put frontmatter if not used to
it (#1614)
---
docs/guide/markdown.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/guide/markdown.md b/docs/guide/markdown.md
index 53421a1b06..6721464184 100644
--- a/docs/guide/markdown.md
+++ b/docs/guide/markdown.md
@@ -57,7 +57,7 @@ You can customize the attributes added to external links by setting [config.mark
## Front Matter
-[YAML front matter](https://jekyllrb.com/docs/frontmatter/) is supported out of the box:
+[YAML front matter](https://jekyllrb.com/docs/frontmatter/) is supported out of the box when placed at the very beginning of your markdown file:
``` yaml
---
From ea929d93b27e67ca499f0e031995c628040ae5e0 Mon Sep 17 00:00:00 2001
From: Mark Noonan
Date: Sun, 21 Jul 2019 21:53:50 -0400
Subject: [PATCH 43/48] docs: clarify example text (#1712)
---
docs/guide/basic-config.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/guide/basic-config.md b/docs/guide/basic-config.md
index cbf03ca18c..b20f72b28e 100644
--- a/docs/guide/basic-config.md
+++ b/docs/guide/basic-config.md
@@ -22,7 +22,7 @@ module.exports = {
}
```
-If you've got the dev server running, you should see the page now has a header with the title and a search box. VuePress comes with built-in headers-based search - it automatically builds a simple search index from the title, `h2` and `h3` headers from all the pages.
+If you've got the dev server running, you should see the page now has a header with the title and a search box. The will be rendered as a `` tag in the page HTML. VuePress comes with built-in headers-based search - it automatically builds a simple search index from the title, `h2` and `h3` headers from all the pages.
Consult the [Config Reference](../config/README.md) for a full list of options.
From 2a508a6a92bcd57820d275271dc806eb0916a463 Mon Sep 17 00:00:00 2001
From: Brad Snyder
Date: Mon, 29 Jul 2019 13:57:31 -0400
Subject: [PATCH 44/48] docs: fixed some of the sentence structure (#1588)
---
docs/config/README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/config/README.md b/docs/config/README.md
index 403deb186c..33bdee0670 100644
--- a/docs/config/README.md
+++ b/docs/config/README.md
@@ -13,11 +13,11 @@ sidebar: auto
- Type: `string`
- Default: `/`
-The base URL the site will be deployed at. You will need to set this if you plan to deploy your site under a sub path, for example GitHub pages. If you plan to deploy your site to `https://foo.github.io/bar/`, then `base` should be set to `"/bar/"`. It should always start and end with a slash.
+The base URL to which the site will be deployed. You will need to set this if you plan to deploy your site under a sub path, for example GitHub pages. If you plan to deploy your site to `https://foo.github.io/bar/`, then `base` should be set to `"/bar/"`. It should always start and end with a forward slash (/).
The `base` is automatically prepended to all the URLs that start with `/` in other options, so you only need to specify it once.
-**Also see:**
+**See also:**
- [Base URL](../guide/assets.md#base-url)
- [Deploy Guide > Github Pages](../guide/deploy.md#github-pages)
From 7f4de6a589bda92045790fb57256ce4e2df3b4dc Mon Sep 17 00:00:00 2001
From: Christy Jacob
Date: Sun, 25 Aug 2019 13:00:25 +0530
Subject: [PATCH 45/48] docs: fix typo (#1798)
Corrected the misspelled word.
---
docs/guide/basic-config.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/guide/basic-config.md b/docs/guide/basic-config.md
index b20f72b28e..f15caa4685 100644
--- a/docs/guide/basic-config.md
+++ b/docs/guide/basic-config.md
@@ -22,7 +22,7 @@ module.exports = {
}
```
-If you've got the dev server running, you should see the page now has a header with the title and a search box. The will be rendered as a `` tag in the page HTML. VuePress comes with built-in headers-based search - it automatically builds a simple search index from the title, `h2` and `h3` headers from all the pages.
+If you've got the dev server running, you should see the page now has a header with the title and a search box. They will be rendered as a `` tag in the page HTML. VuePress comes with built-in headers-based search - it automatically builds a simple search index from the title, `h2` and `h3` headers from all the pages.
Consult the [Config Reference](../config/README.md) for a full list of options.
From 8ed2bb6aa3e4f4ee117e1dda260add84cfd5045a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dani=C3=ABl=20van=20de=20Giessen?=
Date: Tue, 10 Sep 2019 15:50:40 +0200
Subject: [PATCH 46/48] fix($last-updated): use file author time instead of
submodule commit time (#1639)
---
lib/prepare/util.js | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lib/prepare/util.js b/lib/prepare/util.js
index 64c9b60185..579ae8fd4e 100644
--- a/lib/prepare/util.js
+++ b/lib/prepare/util.js
@@ -78,7 +78,11 @@ exports.encodePath = function (userpath) {
exports.getGitLastUpdatedTimeStamp = function (filePath) {
let lastUpdated
try {
- lastUpdated = parseInt(spawn.sync('git', ['log', '-1', '--format=%ct', filePath]).stdout.toString('utf-8')) * 1000
+ lastUpdated = parseInt(spawn.sync(
+ 'git',
+ ['log', '-1', '--format=%ct', path.basename(filePath)],
+ { cwd: path.dirname(filePath) }
+ ).stdout.toString('utf-8')) * 1000
} catch (e) { /* do not handle for now */ }
return lastUpdated
}
From e296f6cf4a51a61c864fe2fecf58639c0dbb43ab Mon Sep 17 00:00:00 2001
From: Brandon Bellero
Date: Mon, 21 Oct 2019 11:28:22 -0400
Subject: [PATCH 47/48] feat($config): allow override of badge colors (#1472)
* allow configurable badge colors
* Update config.styl
* Update badge name
* Update reference to badge variable
* feat($docs): Update v0 documentation for badges color override
* feat($docs): Update zh documentation
---
docs/default-theme-config/README.md | 3 +++
docs/zh/default-theme-config/README.md | 3 +++
lib/app/components/Badge.vue | 6 +++---
lib/default-theme/styles/config.styl | 3 +++
4 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/docs/default-theme-config/README.md b/docs/default-theme-config/README.md
index 2643db6de1..7e2331c87c 100644
--- a/docs/default-theme-config/README.md
+++ b/docs/default-theme-config/README.md
@@ -461,6 +461,9 @@ $accentColor = #3eaf7c
$textColor = #2c3e50
$borderColor = #eaecef
$codeBgColor = #282c34
+$badgeTip = #42b983
+$badgeWarning = darken(#ffe564, 35%)
+$badgeError = #DA596
```
### Existing issues
diff --git a/docs/zh/default-theme-config/README.md b/docs/zh/default-theme-config/README.md
index 94c3b11bf5..1ccd27cf5a 100644
--- a/docs/zh/default-theme-config/README.md
+++ b/docs/zh/default-theme-config/README.md
@@ -443,6 +443,9 @@ $accentColor = #3eaf7c
$textColor = #2c3e50
$borderColor = #eaecef
$codeBgColor = #282c34
+$badgeTip = #42b983
+$badgeWarning = darken(#ffe564, 35%)
+$badgeError = #DA596
```
### 低版本存在的问题
diff --git a/lib/app/components/Badge.vue b/lib/app/components/Badge.vue
index 17e6ba6e7a..faa2e5d285 100644
--- a/lib/app/components/Badge.vue
+++ b/lib/app/components/Badge.vue
@@ -38,9 +38,9 @@ export default {
&.top
vertical-align top
&.tip, &.green
- background-color #42b983
+ background-color $badgeTip
&.error
- background-color #DA5961 //#f66
+ background-color $badgeError
&.warning, &.warn, &.yellow
- background-color darken(#ffe564, 35%)
+ background-color $badgeWarning
diff --git a/lib/default-theme/styles/config.styl b/lib/default-theme/styles/config.styl
index a57d4484de..d48e0b6d01 100644
--- a/lib/default-theme/styles/config.styl
+++ b/lib/default-theme/styles/config.styl
@@ -4,6 +4,9 @@ $textColor = #2c3e50
$borderColor = #eaecef
$codeBgColor = #282c34
$arrowBgColor = #ccc
+$badgeTip = #42b983
+$badgeWarning = darken(#ffe564, 35%)
+$badgeError = #DA5961 //#f66
// layout
$navbarHeight = 3.6rem
From 0f2c9f0f30542c2e0c470ad1fba0e742751961f1 Mon Sep 17 00:00:00 2001
From: Billyyyyy3320
Date: Wed, 30 Oct 2019 23:39:47 +0800
Subject: [PATCH 48/48] docs($cn): add Navbar Logo section for Default Theme
Config (#1983)
---
docs/zh/default-theme-config/README.md | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/docs/zh/default-theme-config/README.md b/docs/zh/default-theme-config/README.md
index 1ccd27cf5a..5105a71ef8 100644
--- a/docs/zh/default-theme-config/README.md
+++ b/docs/zh/default-theme-config/README.md
@@ -35,6 +35,19 @@ footer: MIT Licensed | Copyright © 2018-present Evan You
导航栏可能包含你的页面标题、[搜索框](#搜索框)、 [导航栏链接](#导航栏链接)、[多语言切换](../guide/i18n.md)、[仓库链接](#git-仓库和编辑链接),它们均取决于你的配置。
+### 导航栏标志
+
+你可以通过 `themeConfig.logo` 增加导航栏标志(Logo),标志可以被放置在[公共文件](../guide/assets.md#public-files):
+
+``` js
+// .vuepress/config.js
+module.exports = {
+ themeConfig: {
+ logo: '/assets/img/logo.png',
+ }
+}
+```
+
### 导航栏链接
你可以通过 `themeConfig.nav` 增加一些导航栏链接: