-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathsidebars.js
More file actions
22 lines (19 loc) · 964 Bytes
/
sidebars.js
File metadata and controls
22 lines (19 loc) · 964 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Loader only — the authoritative current-docs navigation lives in
// platform/docs/sidebars.js (next to the content). Do NOT edit navigation here.
//
// - aggregate workspace: platform/ is a sibling, so the authored file is used
// directly (edit-and-see-live);
// - deploy / standalone: deployDocumentation copies the authored file here as
// sidebars.generated.js (gitignored), which this loader falls back to.
const fs = require('fs');
const path = require('path');
const authored = path.resolve(__dirname, '../platform/docs/sidebars.js');
const generated = path.resolve(__dirname, 'sidebars.generated.js');
const sidebar = fs.existsSync(authored) ? authored : generated;
if (!fs.existsSync(sidebar)) {
throw new Error(
'No current-docs sidebar found. Edit platform/docs/sidebars.js in the aggregate ' +
'workspace, or run deployDocumentation to generate docusaurus/sidebars.generated.js.'
);
}
module.exports = require(sidebar);