diff --git a/pages/index.js b/pages/index.js index 97a2d8e..a68ece5 100644 --- a/pages/index.js +++ b/pages/index.js @@ -1,16 +1,13 @@ -import Head from "next/head"; import Layout, {siteTitle} from "../components/layout"; -import {getSinglePost, getGraphData, getDirectoryData} from "../lib/post"; +import {getSinglePost, getGraphData, getDirectoryData, convertObject} from "../lib/post"; +import FolderTree from "../components/FolderTree"; -import dynamic from 'next/dynamic' -const BasicTree = dynamic(() => import('../components/FileNavBar')); - -export default function Home({content, graphdata, filenames, directoryTree, ...props}) { +export default function Home({content, graphdata, filenames, tree, ...props}) { return (
- {/**/} +
@@ -19,24 +16,14 @@ export default function Home({content, graphdata, filenames, directoryTree, ...p } export function getStaticProps() { - - console.log("getStaticProps") - - // const abc = - const convertedData = {name: "Test", children:[ - {name: "Test", children:[ - {name: "Test", children:[ - - ]} - ]} - ]} + const tree = convertObject(getDirectoryData()); const contentData = getSinglePost("index"); const graphdata = getGraphData(); return { props: { content: contentData, graphdata: graphdata, - directoryTree: convertedData, + tree: tree }, }; }