commit e886b8648d55ae5fe9bd44fdd555544d9bbe6f5e Author: magmaus3 Date: Sun Feb 12 13:11:24 2023 +0100 Initial commit. diff --git a/Caddyfile b/Caddyfile new file mode 100644 index 0000000..02d4077 --- /dev/null +++ b/Caddyfile @@ -0,0 +1,5 @@ +:8000 + +file_server { + browse template.html +} diff --git a/style.css b/style.css new file mode 100644 index 0000000..2fcbfcd --- /dev/null +++ b/style.css @@ -0,0 +1,156 @@ +/* This stylesheet file is based on the browse.html template, provided at + * https://github.com/caddyserver/caddy/blob/master/modules/caddyhttp/fileserver/browse.html + */ + +* { padding: 0; margin: 0; } + +body { + padding: 1em; + font-family: monospace; + text-rendering: optimizespeed; + background-color: #20202a; + color: #A09999; +} + +main { + display: block; +} + +.readmeFile > * { + background-color: inherit; + color: inherit; +} + +.readmeHeader { + font-size: small; + color: #979494; + margin-bottom: 1em; +} +.readmeFile { + margin-top: 1em; + padding: 0.5em; + margin: 1rem; + + color: white; +} +.readmeFile li { + list-style-position: inside; +} +/* .readmeFile li { */ + /* margin-left: 1rem; */ + /* margin-right: 1rem; */ +/* } */ + +a { + color: #7dc1ff; + text-decoration: none; +} + +a:active { + border-radius: 1rem; + box-shadow: 3px 3px 15px black; +} + +a:hover, +h1 a:hover { + color: #b0ff94; +} + +a:visited { + color: #fd7dfd; +} + +a:visited:hover { + color: #b0ff94; +} +header { + padding-top: 25px; + padding-bottom: 15px; +} + +h1 { + font-size: 20px; + font-weight: normal; + white-space: nowrap; + overflow-x: hidden; + text-overflow: ellipsis; + color: #999; +} + +h1 a { + /* color: #000; */ + margin: 0 4px; +} + +h1 a:hover { + text-decoration: underline; +} + +h1 a:first-child { + margin: 0; +} +table { + width: 100%; + border-collapse: collapse; +} + +tr { + border-bottom: 1px dashed #555; +} + + +tbody tr:hover { + background-color: #30303A; +} + +th, +td { + text-align: left; + padding: 10px 0; +} + +th { + padding-top: 15px; + padding-bottom: 15px; + font-size: 16px; + white-space: nowrap; +} + +th a { + color: white; +} + + +td { + white-space: nowrap; + font-size: 14px; +} + + +@media (max-width: 600px) { + .hideable { + display: none; + } + + td:nth-child(2) { + width: auto; + } + + th:nth-child(3), + td:nth-child(3) { + padding-right: 5%; + text-align: right; + } + + h1 { + color: #000; + } + + h1 a { + margin: 0; + } + + #filter { + max-width: 100px; + } +} diff --git a/template.html b/template.html new file mode 100644 index 0000000..d46723a --- /dev/null +++ b/template.html @@ -0,0 +1,89 @@ + +{{/* + This template is based on the file provided at + https://github.com/caddyserver/caddy/blob/master/modules/caddyhttp/fileserver/browse.html +*/}} + + + {{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}} +
+ +