render .md files under root as pages (x.md => /x)
1 file changed, 8 insertions(+), 2 deletions(-)
changed files
M internal/storage/files/reader.go → internal/storage/files/reader.go
@@ -78,10 +78,16 @@ } func (r *Reader) CanonicalisePath(path string) (cPath string, differs bool) { cPath = path - if strings.HasSuffix(path, "/index.html") { + switch { + case strings.HasSuffix(path, "/index.html"): cPath, differs = strings.CutSuffix(path, "index.html") - } else if !strings.HasSuffix(path, "/") && r.files[path+"/"] != nil { + + case strings.HasSuffix(path, ".html"): + cPath, differs = strings.CutSuffix(path, ".html") + + case !strings.HasSuffix(path, "/") && r.files[path+"/"] != nil: cPath, differs = path+"/", true + } return cPath, differs