{{/* This template is based on the file provided at https://github.com/caddyserver/caddy/blob/master/modules/caddyhttp/fileserver/browse.html Features: - Simpler design than the original template - README file rendering - embed mode (activated by appending a '?embed' query) */}} {{html .Name}} {{if (not .Req.URL.Query.embed)}}

{{range $i, $crumb := .Breadcrumbs}}{{html $crumb.Text}}{{if ne $i 0}}/{{end}}{{end}}

{{end}}
{{- if .CanGoUp}} {{- end}} {{- range .Items}} {{- if .IsDir}} {{- else}} {{- end}} {{- end}}
{{- if and (eq .Sort "name") (ne .Order "desc")}} Name {{- else if and (eq .Sort "name") (ne .Order "asc")}} Name {{- else}} Name {{- end}} {{- if and (eq .Sort "size") (ne .Order "desc")}} Size {{- else if and (eq .Sort "size") (ne .Order "asc")}} Size {{- else}} Size {{- end}} {{- if and (eq .Sort "time") (ne .Order "desc")}} Modified {{- else if and (eq .Sort "time") (ne .Order "asc")}} Modified {{- else}} Modified {{- end}}
..
{{html .Name}} {{.HumanSize}}
{{if (not .Req.URL.Query.embed)}} {{ $readmeFilePath := list (placeholder "http.request.uri.path") "README" | join ""}} {{if (fileExists $readmeFilePath )}}
README
{{markdown (include $readmeFilePath)}}
{{end}} {{end}}