diff options
author | Steve Manuel <nilslice@gmail.com> | 2016-10-26 00:44:43 -0700 |
---|---|---|
committer | Steve Manuel <nilslice@gmail.com> | 2016-10-26 00:44:43 -0700 |
commit | 3dbc41fbbe547092604b51c6f26261dce05eab26 (patch) | |
tree | 1afb6c795155a9e9d5913b4aed0547ad067b4e76 /content/post.go | |
parent | c81783e87070340701a818eaae59f2304f982f3f (diff) |
changing arrangement of default and generated post / content type
Diffstat (limited to 'content/post.go')
-rw-r--r-- | content/post.go | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/content/post.go b/content/post.go index d121ed7..dcdfeff 100644 --- a/content/post.go +++ b/content/post.go @@ -19,25 +19,6 @@ type Post struct { Theme string `json:"theme"` } -func init() { - Types["Post"] = func() interface{} { return new(Post) } -} - -// SetContentID partially implements editor.Editable -func (p *Post) SetContentID(id int) { p.ID = id } - -// ContentID partially implements editor.Editable -func (p *Post) ContentID() int { return p.ID } - -// ContentName partially implements editor.Editable -func (p *Post) ContentName() string { return p.Title } - -// SetSlug partially implements editor.Editable -func (p *Post) SetSlug(slug string) { p.Slug = slug } - -// Editor partially implements editor.Editable -func (p *Post) Editor() *editor.Editor { return &p.editor } - // MarshalEditor writes a buffer of html to edit a Post and partially implements editor.Editable func (p *Post) MarshalEditor() ([]byte, error) { view, err := editor.Form(p, @@ -88,3 +69,22 @@ func (p *Post) MarshalEditor() ([]byte, error) { return view, nil } + +func init() { + Types["Post"] = func() interface{} { return new(Post) } +} + +// SetContentID partially implements editor.Editable +func (p *Post) SetContentID(id int) { p.ID = id } + +// ContentID partially implements editor.Editable +func (p *Post) ContentID() int { return p.ID } + +// ContentName partially implements editor.Editable +func (p *Post) ContentName() string { return p.Title } + +// SetSlug partially implements editor.Editable +func (p *Post) SetSlug(slug string) { p.Slug = slug } + +// Editor partially implements editor.Editable +func (p *Post) Editor() *editor.Editor { return &p.editor } |