Find all pages which links to current page

I’m creating a site about New Zealand walking tracks - you can check it out at and the source is on github ( - it’s still an alpha/beta version, I’m trying to polish an UI a bit atm so thanks for understanding :slight_smile:

Each track has a special page with a description etc… But I also create special composite track pages - meaning I can create a track which consist of multiple other tracks - for that I use a frontmatter parameter in format of:

tracks = [“fairy-falls-track||0-62.5”, “goodfellow-track”, “old-coach-road-track|r|56-100”]

Which is basically id/url of track page plus some parameters (‘r’ for reversed and then a percentage if it’s not a full track) - this is picked up by javascript and used for drawing maps/elevations as in here -

Anyway - I wonder if it would be somehow possible to find all pages which has the current page in the “tracks” parameter - so I could build a section saying “This track is part of following tracks - [list of pages]”

I just would like to know if there is some existing logic which I can use or if I need to code something like that by myslef (and in that case, what would be a good starting point for doing so?).

Many thanks!