diff options
-rw-r--r-- | cmd/cms/options.go | 17 | ||||
-rw-r--r-- | content/item.go | 5 | ||||
-rw-r--r-- | content/post.go | 15 |
3 files changed, 4 insertions, 33 deletions
diff --git a/cmd/cms/options.go b/cmd/cms/options.go index a1843b3..f95f800 100644 --- a/cmd/cms/options.go +++ b/cmd/cms/options.go @@ -71,7 +71,6 @@ type {{ .name }} struct { Author string ` + "`json:" + `"author"` + "`" + ` Category []string ` + "`json:" + `"category"` + "`" + ` ThemeStyle string ` + "`json:" + `"theme"` + "`" + ` - Timestamp string ` + "`json:" + `"timestamp"` + "`" + ` } func init() { @@ -98,17 +97,9 @@ func ({{ .initial }} *{{ .name }}) MarshalEditor() ([]byte, error) { /* EXAMPLE CODE (from post.go, the default content type) */ view, err := editor.Form({{ .initial }}, editor.Field{ - // Take careful note that the first argument to these Input-like methods + // Take careful note that the first argument to these Input-like methods // is the string version of each {{ .name }} struct tag, and must follow this pattern // for auto-decoding and -encoding reasons. - View: editor.Input("Slug", {{ .initial }}, map[string]string{ - "label": "URL Path", - "type": "text", - "disabled": "true", - "placeholder": "Will be set automatically", - }), - }, - editor.Field{ View: editor.Input("Title", {{ .initial }}, map[string]string{ "label": "{{ .name }} Title", "type": "text", @@ -145,12 +136,6 @@ func ({{ .initial }} *{{ .name }}) MarshalEditor() ([]byte, error) { "light": "Light", }), }, - editor.Field{ - View: editor.Input("Timestamp", {{ .initial }}, map[string]string{ - "label": "Publish Date", - "type": "date", - }), - }, ) if err != nil { diff --git a/content/item.go b/content/item.go index 08d6359..e96a34e 100644 --- a/content/item.go +++ b/content/item.go @@ -2,6 +2,7 @@ package content // Item should only be embedded into content type structs. type Item struct { - ID int `json:"id"` - Slug string `json:"slug"` + ID int `json:"id"` + Slug string `json:"slug"` + Timestamp string `json:"timestamp"` } diff --git a/content/post.go b/content/post.go index 5b98253..14f3330 100644 --- a/content/post.go +++ b/content/post.go @@ -16,7 +16,6 @@ type Post struct { Author string `json:"author"` Category []string `json:"category"` ThemeStyle string `json:"theme"` - Timestamp string `json:"timestamp"` } func init() { @@ -42,14 +41,6 @@ func (p *Post) Editor() *editor.Editor { return &p.editor } func (p *Post) MarshalEditor() ([]byte, error) { view, err := editor.Form(p, editor.Field{ - View: editor.Input("Slug", p, map[string]string{ - "label": "URL Path", - "type": "text", - "disabled": "true", - "placeholder": "Will be set automatically", - }), - }, - editor.Field{ View: editor.Input("Title", p, map[string]string{ "label": "Post Title", "type": "text", @@ -86,12 +77,6 @@ func (p *Post) MarshalEditor() ([]byte, error) { "light": "Light", }), }, - editor.Field{ - View: editor.Input("Timestamp", p, map[string]string{ - "label": "Publish Date", - "type": "date", - }), - }, ) if err != nil { |