feat: metadata draft

This commit is contained in:
2026-02-03 09:04:11 +01:00
parent 7238d02a13
commit d6617cec02
7 changed files with 58 additions and 45 deletions

View File

@ -12,11 +12,10 @@ type Note struct {
Path string
Title string
Content string
Size int64
// HTMLContent string
ModTime time.Time
// Directly in Note
Tags []string
CreatedAt time.Time
UpdatedAt time.Time
Published bool
}
@ -25,8 +24,12 @@ func NewNote() *Note {
return &Note{}
}
func formatDateRep(date time.Time) string {
return date.Format("2006-01-02 15:04:05")
}
func (n *Note) GetUpdateDateRep() string {
return n.UpdatedAt.Format("2006-01-02 15:04:05")
return formatDateRep(n.UpdatedAt)
}
// ExtractTitle return the first level heading content ('# title')