mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
attachments: don't break build if directory wasn't found #480
This commit is contained in:
parent
686c013ef5
commit
472176a88c
1 changed files with 18 additions and 16 deletions
|
@ -39,6 +39,7 @@
|
|||
{{- $filesName = "files" }}
|
||||
{{- end }}
|
||||
{{- $dir := printf "%s%s" $fileDir $filesName }}
|
||||
{{- if fileExists $dir }}
|
||||
{{- range sort (readDir $dir) "Name" $sort }}
|
||||
{{- if findRE $pattern .Name}}
|
||||
{{- $size := .Size }}
|
||||
|
@ -58,6 +59,7 @@
|
|||
<li><a href="{{ $link }}">{{.Name}}</a> ({{$size}} {{$unitsymbol}})</li>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
</ul>
|
||||
{{- $content }}
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue