removed unused title in Post

This commit is contained in:
Niko Abeler 2022-12-05 19:11:48 +01:00
parent bb5aca2bc1
commit 9209f227c4
2 changed files with 2 additions and 8 deletions

View File

@ -20,7 +20,6 @@ import (
type Post struct {
user *User
id string
title string
metaLoaded bool
meta PostMeta
wmLock sync.Mutex
@ -155,7 +154,7 @@ func (post *Post) UrlMediaPath(filename string) string {
}
func (post *Post) Title() string {
return post.title
return post.Meta().Title
}
func (post *Post) ContentFile() string {

View File

@ -285,11 +285,6 @@ func (user User) GetPost(id string) (*Post, error) {
}
post := Post{user: &user, id: id}
// post.loadMeta()
meta := post.Meta()
title := meta.Title
post.title = fmt.Sprint(title)
return &post, nil
}
@ -312,7 +307,7 @@ func (user User) CreateNewPostFull(meta PostMeta, content string) (*Post, error)
break
}
}
post := Post{user: &user, id: folder_name, title: slugHint}
post := Post{user: &user, id: folder_name}
initial_content := ""
initial_content += "---\n"