Skip to content

Commit

Permalink
add demo index
Browse files Browse the repository at this point in the history
  • Loading branch information
JeelRajodiya committed May 12, 2024
1 parent 2dc8e2f commit 05c9a56
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 12 deletions.
31 changes: 23 additions & 8 deletions app/test/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,33 @@ import React from "react";
// metadata,
// } from "@/content/01-introduction/01-why-json-schema.mdx";
import ContentManager from "@/lib/contentManager";
import { CustomMDX } from "../components/mdx";
import { MDXRemote } from "next-mdx-remote/rsc";

import {
List,
ListItem,
ListIcon,
OrderedList,
UnorderedList,
} from "@chakra-ui/react";
export default function Test() {
const cm = new ContentManager();
const { metadata, Page } = cm.parseMdxFile(
"01-introduction/01-why-json-schema.mdx"
);

const outline = cm.outline;
console.log(outline);
return (
<div>
<Page />
<OrderedList>
{outline.map((item) => {
return (
<ListItem key={item.folderName}>
{item.title}
<UnorderedList>
{item.steps.map((step) => (
<ListItem key={step.fileName}>{step.title}</ListItem>
))}
</UnorderedList>
</ListItem>
);
})}
</OrderedList>
</div>
);
}
4 changes: 2 additions & 2 deletions content/01-introduction/01-why-json-schema.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title : "Demo"
author: "Author Name"
title : "why json schema"

---


Expand Down
1 change: 0 additions & 1 deletion content/01-introduction/02-modify-a-array.mdx

This file was deleted.

4 changes: 4 additions & 0 deletions content/01-introduction/02-modify-an-array.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title : "Modify an array"

---
3 changes: 3 additions & 0 deletions content/02-types/01-why-json-schema.mdx
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
---
title: "Strings"

---
3 changes: 3 additions & 0 deletions content/02-types/02-modify-a-array.mdx
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
---
title: "Objects"

---
2 changes: 1 addition & 1 deletion lib/contentManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export default class ContentManager {
contentOutline.push(chapter);
}
});
console.log(contentOutline[0].steps);

return contentOutline;
}
}

0 comments on commit 05c9a56

Please sign in to comment.