Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
tools: move version picker script to main doc directory
Move the version picker JavaScript file to the main doc directory so all
versions of the documentation can share it.

This is a step in addressing the issue of making all versions of a doc
available to all versions that have it in the version picker.

Refs: #32077
  • Loading branch information
Trott committed May 19, 2020
commit ee52f240caaca9d4015802a07ff021a126e65f10
3 changes: 2 additions & 1 deletion tools/doc/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ async function main() {
const basename = path.basename(filename, '.md');
const htmlTarget = path.join(outputDir, `${basename}.html`);
const jsonTarget = path.join(outputDir, `${basename}.json`);
const versionPickerTarget = path.join(outputDir, `.${basename}.versions.js`);
const versionPickerTarget =
path.join(outputDir, '..', `.${basename}.versions.js`);

return Promise.allSettled([
fs.writeFile(htmlTarget, myHtml),
Expand Down
2 changes: 1 addition & 1 deletion tools/doc/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ function toHTML({ input,
return `document.write('${htmlPayload}')`;
}

const versionsJS = `.${filename}.versions.js`;
const versionsJS = `../.${filename}.versions.js`;
return HTML.replace('__ALTDOCS__', `<script src="${versionsJS}"></script>`);
}

Expand Down