Skip to content

Commit

Permalink
fix: minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
esemyonov committed Dec 27, 2023
1 parent 7371cd5 commit e7239b5
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/build/navigation.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,8 @@ function buildNavSection(rawSection) {
for (const item of rawSection.items) {
if (typeof item === "string") {
if (item.startsWith("policies/")) {
let schemaPath = path.resolve(path.join(item, `schema.json`));
let schemaJson;

if (fs.existsSync(schemaPath)) {
schemaJson = fs.readFileSync(schemaPath, "utf8");
} else {
const itemPath = path.join(item.split("/")[1]);

schemaPath = path.resolve("temp", itemPath, `schema.json`);
schemaJson = fs.readFileSync(schemaPath, "utf8");
}
const schemaPath = path.resolve(path.join(item, `schema.json`));
const schemaJson = fs.readFileSync(schemaPath, "utf8");

const schema = JSON.parse(schemaJson);
section.items.push({
Expand Down

0 comments on commit e7239b5

Please sign in to comment.