mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 09:43:06 +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" }}
|
{{- $filesName = "files" }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- $dir := printf "%s%s" $fileDir $filesName }}
|
{{- $dir := printf "%s%s" $fileDir $filesName }}
|
||||||
|
{{- if fileExists $dir }}
|
||||||
{{- range sort (readDir $dir) "Name" $sort }}
|
{{- range sort (readDir $dir) "Name" $sort }}
|
||||||
{{- if findRE $pattern .Name}}
|
{{- if findRE $pattern .Name}}
|
||||||
{{- $size := .Size }}
|
{{- $size := .Size }}
|
||||||
|
@ -58,6 +59,7 @@
|
||||||
<li><a href="{{ $link }}">{{.Name}}</a> ({{$size}} {{$unitsymbol}})</li>
|
<li><a href="{{ $link }}">{{.Name}}</a> ({{$size}} {{$unitsymbol}})</li>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
</ul>
|
</ul>
|
||||||
{{- $content }}
|
{{- $content }}
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue