render .md files under root as pages (x.md => /x)
1 file changed, 10 insertions(+), 3 deletions(-)
changed files
M internal/storage/files/file.go → internal/storage/files/file.go
@@ -87,8 +87,15 @@ return strings.TrimPrefix(pathname, "/") } +func cutSuffix(s, suffix string) string { + out, _ := strings.CutSuffix(s, suffix) + + return out +} + func fileNameToPathName(filename string) string { - pathname, _ := strings.CutSuffix(filename, "index.html") - - return pathname + return cutSuffix( + cutSuffix(filename, "index.html"), + ".html", + ) }