@vuepress/core 1.7.0 → 1.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -43,3 +43,16 @@ export default {
43
43
  top: -1px;
44
44
  }
45
45
  </style>
46
+
47
+ <style lang="stylus">
48
+ .sr-only
49
+ position absolute
50
+ width 1px
51
+ height 1px
52
+ padding 0
53
+ margin -1px
54
+ overflow hidden
55
+ clip rect(0, 0, 0, 0)
56
+ white-space nowrap
57
+ border-width 0
58
+ </style>
@@ -50,5 +50,6 @@ export function handleRedirectForCleanUrls (router) {
50
50
  }
51
51
 
52
52
  function isRouteExists (router, path) {
53
- return router.options.routes.filter(route => route.path.toLowerCase() === path.toLowerCase()).length > 0
53
+ const pathLower = path.toLowerCase()
54
+ return router.options.routes.some(route => route.path.toLowerCase() === pathLower)
54
55
  }
@@ -66,10 +66,10 @@ module.exports = siteData => {
66
66
  }
67
67
 
68
68
  get $canonicalUrl () {
69
- const { canonical } = this.$page.frontmatter
69
+ const { canonicalUrl } = this.$page.frontmatter
70
70
 
71
- if (typeof canonical === 'string') {
72
- return canonical
71
+ if (typeof canonicalUrl === 'string') {
72
+ return canonicalUrl
73
73
  }
74
74
 
75
75
  return false
@@ -1,5 +1,15 @@
1
1
  const { fs, path, chalk, logger } = require('@vuepress/shared-utils')
2
2
 
3
+ // Only empty the `.temp` directory at most once per run to avoid
4
+ // compilation errors caused by removed files.
5
+ // See: https://github.com/vuejs/vuepress/issues/2254#issuecomment-689457157
6
+ //
7
+ // Known issue: This can cause the `.temp` directory to grow while the server
8
+ // is running, but the impact is limited because the `.temp` directory will
9
+ // be cleared when restarting the server.
10
+ // See discussion in https://github.com/vuejs/vuepress/pull/2612
11
+ let alreadyEmptied = false
12
+
3
13
  /**
4
14
  * Create a dynamic temp utility context that allow to lanuch
5
15
  * multiple apps with isolated context at the same time.
@@ -19,8 +29,9 @@ module.exports = function createTemp (tempPath) {
19
29
 
20
30
  if (!fs.existsSync(tempPath)) {
21
31
  fs.ensureDirSync(tempPath)
22
- } else {
32
+ } else if (!alreadyEmptied) {
23
33
  fs.emptyDirSync(tempPath)
34
+ alreadyEmptied = true
24
35
  }
25
36
 
26
37
  logger.debug(`Temp directory: ${chalk.gray(tempPath)}`)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vuepress/core",
3
- "version": "1.7.0",
3
+ "version": "1.8.2",
4
4
  "description": "Minimalistic doc generator with Vue component based layout system",
5
5
  "keywords": [
6
6
  "documentation",
@@ -25,11 +25,11 @@
25
25
  "dependencies": {
26
26
  "@babel/core": "^7.8.4",
27
27
  "@vue/babel-preset-app": "^4.1.2",
28
- "@vuepress/markdown": "1.7.0",
29
- "@vuepress/markdown-loader": "1.7.0",
30
- "@vuepress/plugin-last-updated": "1.7.0",
31
- "@vuepress/plugin-register-components": "1.7.0",
32
- "@vuepress/shared-utils": "1.7.0",
28
+ "@vuepress/markdown": "1.8.2",
29
+ "@vuepress/markdown-loader": "1.8.2",
30
+ "@vuepress/plugin-last-updated": "1.8.2",
31
+ "@vuepress/plugin-register-components": "1.8.2",
32
+ "@vuepress/shared-utils": "1.8.2",
33
33
  "autoprefixer": "^9.5.1",
34
34
  "babel-loader": "^8.0.4",
35
35
  "cache-loader": "^3.0.0",
@@ -74,5 +74,5 @@
74
74
  "email": "chl814@foxmail.com"
75
75
  }
76
76
  ],
77
- "gitHead": "f8aec3e7ffb0c573298790b57ba53fc823e0995e"
77
+ "gitHead": "11eed0f0f105b97a7324cfa8e59d7d27bb966842"
78
78
  }