Parsing Backlinks in Hugo ❚ A Scripter's Notes
As of writing this (%3C2022-04-19%20Tue%3E), Hugo doesn’t have a built-in way to generate a list of such backlinks, though there’s an open issue (# 8077) to track this feature request. One way to gather a list of backlinks to a post is to find out that post’s relative or absolute permalink, and search for the occurrences of that link in all the other posts on the published site. The author of seds.nl: Export org-roam backlinks with Gohugo, Ben Mezger, uses this approach in his solution for creating backlinks in that post. In this post, I am expanding upon that solution and refactoring it bit to fit my needs.