Small clean ups

This commit is contained in:
Peter Stuifzand 2021-08-07 20:18:30 +02:00
parent 8e101418f3
commit 0cd50f7766

View File

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