mirror of
https://git.sr.ht/~adnano/kiln
synced 2024-10-30 01:13:08 +00:00
page: Don't hardcode .gmi file extension
This commit is contained in:
parent
e3a479f921
commit
13b9b8c520
2
page.go
2
page.go
|
@ -56,7 +56,7 @@ func NewPage(path string, content []byte) *Page {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove extension from path
|
// Remove extension from path
|
||||||
page.Path = "/" + strings.TrimSuffix(path, ".gmi") + "/"
|
page.Path = "/" + strings.TrimSuffix(path, pathpkg.Ext(path)) + "/"
|
||||||
page.Content = string(content)
|
page.Content = string(content)
|
||||||
return &page
|
return &page
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue