Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Feb 2, 2021. It is now read-only.

Commit 8ff853d

Browse files
committed
fix(module): remove automatic content permalink prefixing
that broke certain multiple content configuration BREAKING CHANGE: verify your content permalinks, possibly add the missing content type prefix
1 parent 845aa8d commit 8ff853d

File tree

3 files changed

+17
-23
lines changed

3 files changed

+17
-23
lines changed

lib/content/build.js

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,8 @@ export default function buildContent ({ nuxt, options }) {
6969
if (!page) {
7070
throw new Error('You must specify a page path')
7171
}
72-
const pathPrefix = getPrefix(name)
7372
db.findAll(req['query']).forEach(page => {
74-
routePages.push(join(pathPrefix, page.permalink))
73+
routePages.push(page.permalink)
7574
assetMap.set(buildPath(page.permalink, dirName, options), page)
7675
})
7776
break
@@ -139,13 +138,3 @@ function addAssets (nuxtOpts, assetMap) {
139138
}
140139
})
141140
}
142-
143-
function getPrefix (routeName, topLevelPrefix = '/') {
144-
const result = routeName.match(/(^[a-zA-Z]*)(-)/) // matches `prefix-`
145-
if (result) {
146-
// eslint-disable-next-line no-unused-vars
147-
const [_, prefix] = result
148-
if (prefix !== 'index') {return join('/', prefix)}
149-
}
150-
return topLevelPrefix
151-
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
"rollup-plugin-node-resolve": "^3.0.0",
9696
"rollup-plugin-uglify-es": "0.0.1",
9797
"rollup-watch": "^4.3.1",
98+
"serve-static": "^1.12.6",
9899
"sinon": "^3.3.0",
99100
"sinon-chai": "^2.13.0"
100101
},

yarn.lock

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5402,8 +5402,8 @@ [email protected]:
54025402
resolved "https://registry.yarnpkg.com/mime/-/mime-1.3.6.tgz#591d84d3653a6b0b4a3b9df8de5aa8108e72e5e0"
54035403

54045404
mime@^1.2.11, mime@^1.3.4:
5405-
version "1.4.0"
5406-
resolved "https://registry.yarnpkg.com/mime/-/mime-1.4.0.tgz#69e9e0db51d44f2a3b56e48b7817d7d137f1a343"
5405+
version "1.4.1"
5406+
resolved "https://registry.yarnpkg.com/mime/-/mime-1.4.1.tgz#121f9ebc49e3766f311a76e1fa1c8003c4b03aa6"
54075407

54085408
mimic-fn@^1.0.0:
54095409
version "1.1.0"
@@ -7814,16 +7814,16 @@ [email protected], samsam@^1.1.3:
78147814
resolved "https://registry.yarnpkg.com/samsam/-/samsam-1.2.1.tgz#edd39093a3184370cb859243b2bdf255e7d8ea67"
78157815

78167816
sane@^2.0.0:
7817-
version "2.0.0"
7818-
resolved "https://registry.yarnpkg.com/sane/-/sane-2.0.0.tgz#99cb79f21f4a53a69d4d0cd957c2db04024b8eb2"
7817+
version "2.1.0"
7818+
resolved "https://registry.yarnpkg.com/sane/-/sane-2.1.0.tgz#24d430f111dd8d3c9336978329976abf4a3d0bd4"
78197819
dependencies:
78207820
anymatch "^1.3.0"
78217821
exec-sh "^0.2.0"
78227822
fb-watchman "^2.0.0"
78237823
minimatch "^3.0.2"
78247824
minimist "^1.1.1"
78257825
walker "~1.0.5"
7826-
watch "~0.10.0"
7826+
watch "~0.18.0"
78277827
optionalDependencies:
78287828
fsevents "^1.1.1"
78297829

@@ -7904,7 +7904,7 @@ serialize-javascript@^1.3.0, serialize-javascript@^1.4.0:
79047904
version "1.4.0"
79057905
resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-1.4.0.tgz#7c958514db6ac2443a8abc062dc9f7886a7f6005"
79067906

7907-
[email protected], serve-static@^1.12.4:
7907+
[email protected], serve-static@^1.12.4, serve-static@^1.12.6:
79087908
version "1.12.6"
79097909
resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.12.6.tgz#b973773f63449934da54e5beba5e31d9f4211577"
79107910
dependencies:
@@ -7934,10 +7934,11 @@ [email protected]:
79347934
resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.0.3.tgz#66567e37043eeb4f04d91bd658c0cbefb55b8e04"
79357935

79367936
sha.js@^2.4.0, sha.js@^2.4.8:
7937-
version "2.4.8"
7938-
resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.8.tgz#37068c2c476b6baf402d14a49c67f597921f634f"
7937+
version "2.4.9"
7938+
resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.9.tgz#98f64880474b74f4a38b8da9d3c0f2d104633e7d"
79397939
dependencies:
79407940
inherits "^2.0.1"
7941+
safe-buffer "^5.0.1"
79417942

79427943
sha@~2.0.1:
79437944
version "2.0.1"
@@ -8953,9 +8954,12 @@ [email protected], walker@~1.0.5:
89538954
dependencies:
89548955
makeerror "1.0.x"
89558956

8956-
watch@~0.10.0:
8957-
version "0.10.0"
8958-
resolved "https://registry.yarnpkg.com/watch/-/watch-0.10.0.tgz#77798b2da0f9910d595f1ace5b0c2258521f21dc"
8957+
watch@~0.18.0:
8958+
version "0.18.0"
8959+
resolved "https://registry.yarnpkg.com/watch/-/watch-0.18.0.tgz#28095476c6df7c90c963138990c0a5423eb4b986"
8960+
dependencies:
8961+
exec-sh "^0.2.0"
8962+
minimist "^1.2.0"
89598963

89608964
watchpack@^1.4.0:
89618965
version "1.4.0"

0 commit comments

Comments
 (0)