page: Don't hardcode .gmi file extension

This commit is contained in:
adnano 2021-02-27 21:42:37 -05:00
parent e3a479f921
commit 13b9b8c520

View file

@ -56,7 +56,7 @@ func NewPage(path string, content []byte) *Page {
}
// Remove extension from path
page.Path = "/" + strings.TrimSuffix(path, ".gmi") + "/"
page.Path = "/" + strings.TrimSuffix(path, pathpkg.Ext(path)) + "/"
page.Content = string(content)
return &page
}