mirror of
https://git.sr.ht/~adnano/kiln
synced 2024-10-30 01:13:08 +00:00
Add trailing slash to page paths
This commit is contained in:
parent
9676566325
commit
71f415e54d
14
main.go
14
main.go
|
@ -58,24 +58,14 @@ type outputFormat func(*Page, *Config) (path string, content []byte)
|
|||
|
||||
// outputGemini outputs the page as Gemini text.
|
||||
func outputGemini(p *Page, cfg *Config) (path string, content []byte) {
|
||||
path = p.Path
|
||||
if strings.HasSuffix(path, "/") {
|
||||
path += "index.gmi"
|
||||
} else {
|
||||
path += "/index.gmi"
|
||||
}
|
||||
path = p.Path + "index.gmi"
|
||||
content = []byte(p.Content)
|
||||
return
|
||||
}
|
||||
|
||||
// outputHTML outputs the page as HTML.
|
||||
func outputHTML(p *Page, cfg *Config) (path string, content []byte) {
|
||||
path = p.Path
|
||||
if strings.HasSuffix(path, "/") {
|
||||
path += "index.html"
|
||||
} else {
|
||||
path += "/index.html"
|
||||
}
|
||||
path = p.Path + "index.html"
|
||||
|
||||
r := strings.NewReader(p.Content)
|
||||
text := gemini.ParseText(r)
|
||||
|
|
Loading…
Reference in a new issue