Last active
July 21, 2023 10:36
-
-
Save Flygsand/7530825fe5e56035b3591218f0f71503 to your computer and use it in GitHub Desktop.
Tinfoil index for Caddy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{- $directories := list -}} | |
{{- $files := list -}} | |
{{- range .Items -}} | |
{{- if .IsDir -}} | |
{{- $directories = mustAppend $directories . -}} | |
{{- else -}} | |
{{- $files = mustAppend $files . -}} | |
{{- end -}} | |
{{- end -}} | |
{ | |
"directories": [ | |
{{- range $i, $d := $directories }} | |
{{- if gt $i 0 -}},{{- end }} | |
{{ mustToJson $d.URL }} | |
{{- end }} | |
], | |
"files": [ | |
{{- range $i, $f := $files }} | |
{{- if gt $i 0 -}},{{- end }} | |
{ | |
"url": {{mustToJson $f.URL}}, | |
"size": {{mustToJson $f.Size}} | |
} | |
{{- end}} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment