update imports, classname and remove graphdata from note index
This commit is contained in:
parent
4292c53fde
commit
67f7658907
@ -1,4 +1,4 @@
|
|||||||
import Layout from "../components/Layout";
|
import Layout from "../../components/Layout";
|
||||||
import {
|
import {
|
||||||
getSinglePost,
|
getSinglePost,
|
||||||
getDirectoryData,
|
getDirectoryData,
|
||||||
@ -6,16 +6,16 @@ import {
|
|||||||
getFlattenArray,
|
getFlattenArray,
|
||||||
getLocalGraphData,
|
getLocalGraphData,
|
||||||
constructGraphData
|
constructGraphData
|
||||||
} from "../lib/utils";
|
} from "../../lib/utils";
|
||||||
import FolderTree from "../components/FolderTree";
|
import FolderTree from "../../components/FolderTree";
|
||||||
import MDContent from "../components/MDContent";
|
import MDContent from "../../components/MDContent";
|
||||||
|
|
||||||
|
|
||||||
// This trick is to dynamically load component that interact with window object (browser only)
|
// This trick is to dynamically load component that interact with window object (browser only)
|
||||||
export default function Home({ content, tree, flattenNodes, backLinks }) {
|
export default function Home({ content, tree, flattenNodes, backLinks }) {
|
||||||
return (
|
return (
|
||||||
<Layout>
|
<Layout>
|
||||||
<div className='container'>
|
<div className='notes-container'>
|
||||||
<nav className="nav-bar">
|
<nav className="nav-bar">
|
||||||
<FolderTree tree={tree} flattenNodes={flattenNodes} />
|
<FolderTree tree={tree} flattenNodes={flattenNodes} />
|
||||||
</nav>
|
</nav>
|
||||||
@ -35,13 +35,11 @@ export function getStaticProps() {
|
|||||||
const internalLinks = listOfEdges.map(anEdge => nodes.find(aNode => aNode.slug === anEdge.source)).filter(element => element !== undefined)
|
const internalLinks = listOfEdges.map(anEdge => nodes.find(aNode => aNode.slug === anEdge.source)).filter(element => element !== undefined)
|
||||||
const backLinks = [...new Set(internalLinks)]
|
const backLinks = [...new Set(internalLinks)]
|
||||||
|
|
||||||
const graphData = getLocalGraphData("index");
|
|
||||||
return {
|
return {
|
||||||
props: {
|
props: {
|
||||||
content: contentData.data,
|
content: contentData.data,
|
||||||
tree: tree,
|
tree: tree,
|
||||||
flattenNodes: flattenNodes,
|
flattenNodes: flattenNodes,
|
||||||
graphData: graphData,
|
|
||||||
backLinks: backLinks
|
backLinks: backLinks
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user