fileExists
Syntax
fileExists PATH
fileExists
allows you to check if a file exists under a given path, e.g. before inserting code into a template:
{{ if (fileExists "static/img/banner.jpg") -}}
<img src="{{ "img/banner.jpg" | absURL }}" />
{{- end }}
In the example above, a banner from the static
folder should be shown if the given path points to an existing file.