diff --git a/lib/utils.js b/lib/utils.js index c7ff7ea..b521d7d 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -100,6 +100,7 @@ export function constructGraphData() { .forEach(aFilePath => { // const {currentFilePath} = getFileNames(filename) const aNode = { + title: Transformer.parseFileNameFromPath(aFilePath), slug: toSlug(aFilePath), shortSummary: getShortSummary(toSlug(aFilePath)) } diff --git a/pages/note/[id].js b/pages/note/[id].js index 38500f5..c575f58 100644 --- a/pages/note/[id].js +++ b/pages/note/[id].js @@ -55,14 +55,14 @@ export function getStaticProps({params}) { const listOfEdges = edges.filter(anEdge => anEdge.target === params.id) const internalLinks = listOfEdges.map(anEdge => nodes.find(aNode => aNode.slug === anEdge.source)).filter(element => element !== undefined) - + const backLinks = [...new Set(internalLinks)] const graphData = getLocalGraphData(params.id) return { props: { note, tree: tree, flattenNodes: flattenNodes, - backLinks: internalLinks, + backLinks: backLinks.filter(link => link.slug !== params.id), graphData: graphData }, };