@matt Just one more thing, after setting up the template to load markdown files without an ending I now get an infinite loop after calling a file with the md ending in my browser (Safari):
https://xxxxx/agb works as expected
https://xxxxx/agb.md gets me an infinite loop
Template code:
{{$pathParts := splitList "/" .OriginalReq.URL.Path}}
{{$markdownFilename := default "index" (slice $pathParts 1 | join "/")}}
{{$markdownFilenameWithMD := printf "%s.md" $markdownFilename }}
{{$markdownFile := (include $markdownFilenameWithMD | splitFrontMatter)}}
{{$title := default $markdownFilename $markdownFile.Meta.title}}
{{$body := $markdownFile.Body}}
Error log:
{"level":"error","ts":1622528506.8743768,"logger":"http.log.error.log0","msg":"template: index.html:4:20: executing \"index.html\" at <include $markdownFilenameWithMD>: error calling include: open /srv/agb.md.md: no such file or directory","request":{"remote_addr":"94.216.24.44:61049","proto":"HTTP/2.0","method":"GET","host":"","uri":"/agb.md","headers":{"User-Agent":["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15"],"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"],"Accept-Language":["en-us"],"Accept-Encoding":["gzip, deflate, br"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","proto_mutual":true,"server_name":""}},"duration":0.000547147,"status":500,"err_id":"dtsy5nu0q","err_trace":"templates.(*Templates).executeTemplate (templates.go:315)"}
{"level":"error","ts":1622528506.8744237,"logger":"http.log.access.log0","msg":"handled request","request":{"remote_addr":"94.216.24.44:61049","proto":"HTTP/2.0","method":"GET","host":"","uri":"/agb.md","headers":{"User-Agent":["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15"],"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"],"Accept-Language":["en-us"],"Accept-Encoding":["gzip, deflate, br"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","proto_mutual":true,"server_name":""}},"common_log":"94.216.24.44 - - [01/Jun/2021:06:21:46 +0000] \"GET /agb.md HTTP/2.0\" 500 0","duration":0.000547147,"size":0,"status":500,"resp_headers":{"Server":["Caddy"],"Etag":["\"qu0ecqvu\""],"Content-Type":["text/html; charset=utf-8"],"Last-Modified":["Tue, 01 Jun 2021 06:07:38 GMT"],"Accept-Ranges":["bytes"],"Content-Length":["1146"]}}
curl output:
* Connection state changed (MAX_CONCURRENT_STREAMS == 250)!
* HTTP/2 stream 0 was closed cleanly, but before getting all response header fields, treated as error
* stopped the pause stream!
* Connection #0 to host left intact
curl: (92) HTTP/2 stream 0 was closed cleanly, but before getting all response header fields, treated as error
* Closing connection 0