{{ $pathSplit := splitList "/" .Req.URL.Path }} {{ $base := last $pathSplit | default "index.gmi" }} {{ $filePath := append (initial $pathSplit) $base | join "/" | printf "static%s" }} {{ if not (fileExists $filePath) }}{{ httpError 404 }}{{ end }}