Is there any way I can load a json file this way and process it within a partial or shortcode?
The issue is, I need to use the RelPermalink as file name and directory.
I am pretty sure I misunderstand what you want (given that there is no JSON in your code sample), but If itβs about loading a json file into a variable, this is the way:
{{ $dataJ := getJSON "content/" .File.Dir "data.json" }}
{{ with $dataJ.somesubkey }}
<p>{{ . | safeHTML }}</p>
{{ end }}
edit: The .File.Dir extends to the directory of the current file. I use that in page-bundles where json lives right next to the index.md file.