flowershow icon indicating copy to clipboard operation
flowershow copied to clipboard

Backlinks and Forward links

Open rufuspollock opened this issue 3 years ago • 7 comments
trafficstars

Show backlinks for a page (optional / configurable). Backlinks are all the pages that link to this page.

rufuspollock avatar Jul 12 '22 11:07 rufuspollock

This will enhance the user experience greatly as this is a common denominator to all PKM apps.

meherhowji avatar Jun 02 '23 09:06 meherhowji

@meherranjan we have the core work for this implemented in the backend. Where would you want this displayed on the frontend exactly? On the network map or where? cf #37

rufuspollock avatar Jun 02 '23 13:06 rufuspollock

@rufuspollock In my experience, from the webpage point of view backlinks at the bottom/sidebar of the article can be more valuable in driving the overall engagement. Graph maps can be a wow factor.

meherhowji avatar Jun 02 '23 17:06 meherhowji

@rufuspollock by the way I was able to get backlinks working for me on my site, it still needs catching edge cases but the main idea is as simple as this:

function getBacklinks(slug) {
  const backlinkList = allPosts.filter(doc => doc.body.raw.includes('[[' + slug))
  return backlinkList.map(({ title, slug }) => ({ title, slug }))
}
// consume the function in the getstaticprops and pass it your component along with the post data

Post with backlinks: https://meherhowji-com-git-contentlayer-meherranjan.vercel.app/default-binding-this-keyword Main website URL: https://meherhowji.com

I am yet to merge this feature branch to master hence the URL is auto-generated by Vercel.

Maybe this idea could be extended to render a network graph on the client side too. Honestly I plan to the consume the package you will publish as it seems to be one of your top Todos. 😃

meherhowji avatar Jun 07 '23 13:06 meherhowji

@meherranjan this is great. 👏

rufuspollock avatar Jun 07 '23 14:06 rufuspollock