For anyone that uses this in the future, note that the .Path
does not work for 2 reasons:
- There is some warning in the terminal that you need to do this (I don’t really understand it, but it works now without the depreciation warning. This is the code given in the warning.):
{{ $path := "" }}
{{ with .File }}
{{ $path = .Path }}
{{ else }}
{{ $path = .Path }}
{{ end }}
-
$Path
renders the link as a computer file. I.e. with a backslash instead of forward slash. You therefore have to do the following:
{{path.Clean $path }}