diff --git a/layouts/partials/shortcodes/attachments.html b/layouts/partials/shortcodes/attachments.html index b9485429e1..e6867cf45c 100644 --- a/layouts/partials/shortcodes/attachments.html +++ b/layouts/partials/shortcodes/attachments.html @@ -43,7 +43,7 @@ {{- end }} {{- $fileDir = printf "%s/" (path.Clean (strings.TrimPrefix "/" $fileDir)) }} {{- $fileLink := $fileDir }} - {{- $fileLink = replace $fileLink "/content/" "" }} + {{- $fileLink = strings.TrimPrefix "content/" $fileLink }} {{- $filesName := printf "%s.files" .File.BaseFileName }} {{- if and (eq .File.BaseFileName "index") (fileExists (printf "%sfiles" $fileDir)) }} {{- $c := "" }}{{/* backward compat to < 5.9.0 behavior */}}