From 119ff2e41cef99d0588ebde435151239012163c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Mon, 29 May 2023 12:46:48 +0200 Subject: [PATCH] attachments: work for Hugo < 0.112 #546 --- layouts/partials/shortcodes/attachments.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 */}}