- Add title back to Backlink
- Remove duplicated backlink and self-reference.
This commit is contained in:
parent
ce8de2da9f
commit
758a8c90b4
@ -100,6 +100,7 @@ export function constructGraphData() {
|
|||||||
.forEach(aFilePath => {
|
.forEach(aFilePath => {
|
||||||
// const {currentFilePath} = getFileNames(filename)
|
// const {currentFilePath} = getFileNames(filename)
|
||||||
const aNode = {
|
const aNode = {
|
||||||
|
title: Transformer.parseFileNameFromPath(aFilePath),
|
||||||
slug: toSlug(aFilePath),
|
slug: toSlug(aFilePath),
|
||||||
shortSummary: getShortSummary(toSlug(aFilePath))
|
shortSummary: getShortSummary(toSlug(aFilePath))
|
||||||
}
|
}
|
||||||
|
@ -55,14 +55,14 @@ export function getStaticProps({params}) {
|
|||||||
|
|
||||||
const listOfEdges = edges.filter(anEdge => anEdge.target === params.id)
|
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 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)
|
const graphData = getLocalGraphData(params.id)
|
||||||
return {
|
return {
|
||||||
props: {
|
props: {
|
||||||
note,
|
note,
|
||||||
tree: tree,
|
tree: tree,
|
||||||
flattenNodes: flattenNodes,
|
flattenNodes: flattenNodes,
|
||||||
backLinks: internalLinks,
|
backLinks: backLinks.filter(link => link.slug !== params.id),
|
||||||
graphData: graphData
|
graphData: graphData
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user