but if i use the same theme for a non-translated site i get wrong links. The solution for me would be to access the variable contentDir of the configuration of Hugo instead of hardcoding - is there any way to retrieve that?
You are the best! That worked right away… oh my. I just had to add one additional forward slash after file to it:
{{ with .File }}
<a {{ printf "href=%q" (print "vscode://file/" .Filename) | safeHTMLAttr }}>Edit</a>
{{ end }}
The solution is great for the local edits but i guess i cannot access the contentDir directly, right? Scenario would be to edit the file in a github repo (instead of a local path via vscode), i have no option currently?