diff --git a/file.go b/file.go index f6fde93..0a2c683 100644 --- a/file.go +++ b/file.go @@ -121,6 +121,7 @@ func NewFilePages(dirname string, index bleve.Index) PagesRepository { } } }() + return fp } @@ -134,7 +135,7 @@ func convertBlocksToListItems(current string, blocks BlockResponse, indent int) ID: child, Indented: indent, Text: blocks.Texts[child], - Fold: "open", // TODO: keep Fold state somewhere + Fold: "open", Hidden: false, }) listItems = append(listItems, l...) @@ -159,6 +160,7 @@ func (fp *FilePages) Get(name string) Page { var to titleOption pageNameDate, err := ParseDatePageName(name) + if err == nil { to.date = true to.timeObj = pageNameDate @@ -321,7 +323,7 @@ func (fp *FilePages) save(msg saveMessage) error { sw.Start("git") err = saveWithGit(fp, p, summary, author) if err != nil { - log.Printf("Error while saving to git: %w", err) + log.Printf("Error while saving to git: %s", err) // return fmt.Errorf("while saving to git: %w", err) } sw.Stop() @@ -584,7 +586,6 @@ func saveLinksIncremental(dirname, title string) error { return err } f.Close() - return nil }