page: Don't hardcode .gmi file extension

This commit is contained in:
Adnan Maolood 2021-02-27 21:42:37 -05:00
parent 81e1bf4643
commit faae5cc44d

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
}