feat: metadata draft
This commit is contained in:
@ -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')
|
||||
|
||||
Reference in New Issue
Block a user