Skip to content

Commit

Permalink
[Issue 5839][website]Fix version replace for old version document (ap…
Browse files Browse the repository at this point in the history
…ache#5865)

Fixes apache#5839

Motivation
Currently, for different contents, we use the same variables in multiple versions.

Modifications
When replacing the latest version, the old version is ignored
Set option dry to false for enable replace

Verifying this change
yarn build
node scripts/replace.js
  • Loading branch information
tuteng authored and jiazhai committed Dec 18, 2019
1 parent dc34ee1 commit e5a9a66
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions site2/website/scripts/replace.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ const options = {
`${docsDir}/*.html`,
`${docsDir}/**/*.html`
],
ignore: versions.map(v => `${docsDir}/${v}/**/*`), // TODO add next and assets
// TODO add next and assets
ignore: versions.map(v => `${docsDir}/${v}/**/*`).concat(versions.map(v => `${docsDir}/en/${v}/**/*`)),
from: from,
to: [
`${latestVersionWithoutIncubating}`,
Expand Down Expand Up @@ -167,7 +168,9 @@ for (v of versions) {
const opts = {
files: [
`${docsDir}/${v}/*.html`,
`${docsDir}/${v}/**/*.html`
`${docsDir}/${v}/**/*.html`,
`${docsDir}/en/${v}/*.html`,
`${docsDir}/en/${v}/**/*.html`
],
from: from,
to: [
Expand All @@ -183,7 +186,7 @@ for (v of versions) {
debReleaseUrl(`${v}`, ""),
debReleaseUrl(`${v}`, "-dev"),
],
dry: true
dry: false
};
doReplace(opts);
}

0 comments on commit e5a9a66

Please sign in to comment.