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

Commit

Permalink
fix(module): remove automatic content permalink prefixing
Browse files Browse the repository at this point in the history
that broke certain multiple content configuration

BREAKING CHANGE: verify your content permalinks, possibly add the missing content type prefix
  • Loading branch information
medfreeman committed Sep 25, 2017
1 parent 845aa8d commit 8ff853d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 23 deletions.
13 changes: 1 addition & 12 deletions lib/content/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,8 @@ export default function buildContent ({ nuxt, options }) {
if (!page) {
throw new Error('You must specify a page path')
}
const pathPrefix = getPrefix(name)
db.findAll(req['query']).forEach(page => {
routePages.push(join(pathPrefix, page.permalink))
routePages.push(page.permalink)
assetMap.set(buildPath(page.permalink, dirName, options), page)
})
break
Expand Down Expand Up @@ -139,13 +138,3 @@ function addAssets (nuxtOpts, assetMap) {
}
})
}

function getPrefix (routeName, topLevelPrefix = '/') {
const result = routeName.match(/(^[a-zA-Z]*)(-)/) // matches `prefix-`
if (result) {
// eslint-disable-next-line no-unused-vars
const [_, prefix] = result
if (prefix !== 'index') {return join('/', prefix)}
}
return topLevelPrefix
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
"rollup-plugin-node-resolve": "^3.0.0",
"rollup-plugin-uglify-es": "0.0.1",
"rollup-watch": "^4.3.1",
"serve-static": "^1.12.6",
"sinon": "^3.3.0",
"sinon-chai": "^2.13.0"
},
Expand Down
26 changes: 15 additions & 11 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5402,8 +5402,8 @@ [email protected]:
resolved "https://registry.yarnpkg.com/mime/-/mime-1.3.6.tgz#591d84d3653a6b0b4a3b9df8de5aa8108e72e5e0"

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

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

sane@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/sane/-/sane-2.0.0.tgz#99cb79f21f4a53a69d4d0cd957c2db04024b8eb2"
version "2.1.0"
resolved "https://registry.yarnpkg.com/sane/-/sane-2.1.0.tgz#24d430f111dd8d3c9336978329976abf4a3d0bd4"
dependencies:
anymatch "^1.3.0"
exec-sh "^0.2.0"
fb-watchman "^2.0.0"
minimatch "^3.0.2"
minimist "^1.1.1"
walker "~1.0.5"
watch "~0.10.0"
watch "~0.18.0"
optionalDependencies:
fsevents "^1.1.1"

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

[email protected], serve-static@^1.12.4:
[email protected], serve-static@^1.12.4, serve-static@^1.12.6:
version "1.12.6"
resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.12.6.tgz#b973773f63449934da54e5beba5e31d9f4211577"
dependencies:
Expand Down Expand Up @@ -7934,10 +7934,11 @@ [email protected]:
resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.0.3.tgz#66567e37043eeb4f04d91bd658c0cbefb55b8e04"

sha.js@^2.4.0, sha.js@^2.4.8:
version "2.4.8"
resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.8.tgz#37068c2c476b6baf402d14a49c67f597921f634f"
version "2.4.9"
resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.9.tgz#98f64880474b74f4a38b8da9d3c0f2d104633e7d"
dependencies:
inherits "^2.0.1"
safe-buffer "^5.0.1"

sha@~2.0.1:
version "2.0.1"
Expand Down Expand Up @@ -8953,9 +8954,12 @@ [email protected], walker@~1.0.5:
dependencies:
makeerror "1.0.x"

watch@~0.10.0:
version "0.10.0"
resolved "https://registry.yarnpkg.com/watch/-/watch-0.10.0.tgz#77798b2da0f9910d595f1ace5b0c2258521f21dc"
watch@~0.18.0:
version "0.18.0"
resolved "https://registry.yarnpkg.com/watch/-/watch-0.18.0.tgz#28095476c6df7c90c963138990c0a5423eb4b986"
dependencies:
exec-sh "^0.2.0"
minimist "^1.2.0"

watchpack@^1.4.0:
version "1.4.0"
Expand Down

0 comments on commit 8ff853d

Please sign in to comment.