2022-03-17 08:42:57 +00:00
|
|
|
import Layout, {siteTitle} from "../components/layout";
|
2022-03-24 04:55:12 +00:00
|
|
|
import {getSinglePost, getGraphData, getDirectoryData, convertObject, getFlattenArray} from "../lib/utils";
|
2022-03-23 15:25:39 +00:00
|
|
|
import FolderTree from "../components/FolderTree";
|
2022-03-24 07:43:18 +00:00
|
|
|
import {Box} from '@mui/material'
|
2020-12-01 03:28:42 +00:00
|
|
|
|
2022-03-24 07:43:18 +00:00
|
|
|
export default function Home({content, graphdata, filenames, tree, flattenNodes, ...props}) {
|
2020-12-01 03:28:42 +00:00
|
|
|
|
2020-11-28 15:45:01 +00:00
|
|
|
return (
|
|
|
|
<Layout home>
|
2022-03-24 07:43:18 +00:00
|
|
|
<div className = 'container'>
|
|
|
|
<nav className="nav-bar">
|
|
|
|
<FolderTree tree={tree} flattenNodes={flattenNodes}/>
|
|
|
|
</nav>
|
|
|
|
<main className="markdown-rendered">
|
|
|
|
<div dangerouslySetInnerHTML={{__html: content.data}}/>
|
|
|
|
</main>
|
|
|
|
</div>
|
2020-11-28 15:45:01 +00:00
|
|
|
</Layout>
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
export function getStaticProps() {
|
2022-03-23 15:25:39 +00:00
|
|
|
const tree = convertObject(getDirectoryData());
|
2020-12-01 03:28:42 +00:00
|
|
|
const contentData = getSinglePost("index");
|
2020-11-30 11:29:34 +00:00
|
|
|
const graphdata = getGraphData();
|
2022-03-24 04:15:43 +00:00
|
|
|
const flattenNodes = getFlattenArray(tree)
|
2020-11-28 15:45:01 +00:00
|
|
|
return {
|
|
|
|
props: {
|
2022-03-17 08:42:57 +00:00
|
|
|
content: contentData,
|
|
|
|
graphdata: graphdata,
|
2022-03-24 04:15:43 +00:00
|
|
|
tree: tree,
|
|
|
|
flattenNodes: flattenNodes
|
2020-11-28 15:45:01 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|