mirror of
https://git.sr.ht/~adnano/kiln
synced 2024-10-30 01:13:08 +00:00
page: Don't trim dates from paths without dates
This commit is contained in:
parent
38439877b9
commit
e4d3b016d8
2
page.go
2
page.go
|
@ -30,7 +30,6 @@ func NewPage(path string, content []byte) *Page {
|
|||
dateStr := base[:len(layout)]
|
||||
if time, err := time.Parse(layout, dateStr); err == nil {
|
||||
page.Date = time
|
||||
}
|
||||
// Remove the date from the path
|
||||
base = base[len(layout):]
|
||||
if len(base) > 0 {
|
||||
|
@ -47,6 +46,7 @@ func NewPage(path string, content []byte) *Page {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Try to parse the title from the contents
|
||||
if submatches := titleRE.FindSubmatch(content); submatches != nil {
|
||||
|
|
Loading…
Reference in a new issue