Skip to content

Commit

Permalink
chore: fix docs assets build logic
Browse files Browse the repository at this point in the history
  • Loading branch information
timurbazhirov committed Dec 24, 2023
1 parent 0b8c77a commit 353c3b9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build_schemas.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ wrappedExamples.forEach((example) => {
fs.mkdirSync(path.dirname(full_path), {recursive: true})
fs.writeFileSync(
full_path,
JSON.stringify(example, null, 4),
JSON.stringify(example["data"], null, 4),
"utf8",
);
})
6 changes: 5 additions & 1 deletion src/js/esse/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ export function parseIncludeReferenceStatementsByDir(dirPath, wrapInDataAndPath=
if (filePath.endsWith(".json")) {
const config = parseIncludeReferenceStatements(filePath);
if (wrapInDataAndPath) {
const _path = path.dirname(filePath).replace(path.join(topDir, "example"), "");
const _path = path.join(
// remove leading slashes and "example" from path
path.dirname(filePath).replace(path.join(topDir, "example"), "").replace(/^\/+/, ''),
path.basename(filePath).replace(".json", "")
);
data.push({ data: config, path: _path });
} else {
data.push(config);
Expand Down

0 comments on commit 353c3b9

Please sign in to comment.