attachments: work for Hugo < 0.112 #546

This commit is contained in:
Sören Weber 2023-05-29 12:46:48 +02:00
parent 152745ee50
commit 119ff2e41c
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D

View file

@ -43,7 +43,7 @@
{{- end }} {{- end }}
{{- $fileDir = printf "%s/" (path.Clean (strings.TrimPrefix "/" $fileDir)) }} {{- $fileDir = printf "%s/" (path.Clean (strings.TrimPrefix "/" $fileDir)) }}
{{- $fileLink := $fileDir }} {{- $fileLink := $fileDir }}
{{- $fileLink = replace $fileLink "/content/" "" }} {{- $fileLink = strings.TrimPrefix "content/" $fileLink }}
{{- $filesName := printf "%s.files" .File.BaseFileName }} {{- $filesName := printf "%s.files" .File.BaseFileName }}
{{- if and (eq .File.BaseFileName "index") (fileExists (printf "%sfiles" $fileDir)) }} {{- if and (eq .File.BaseFileName "index") (fileExists (printf "%sfiles" $fileDir)) }}
{{- $c := "" }}{{/* backward compat to < 5.9.0 behavior */}} {{- $c := "" }}{{/* backward compat to < 5.9.0 behavior */}}