diff options
Diffstat (limited to 'cmd/ponzu/options.go')
-rw-r--r-- | cmd/ponzu/options.go | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/cmd/ponzu/options.go b/cmd/ponzu/options.go index cabe91a..6f42f0c 100644 --- a/cmd/ponzu/options.go +++ b/cmd/ponzu/options.go @@ -72,12 +72,12 @@ type {{ .name }} struct { editor editor.Editor // required: all maintained {{ .name }} fields must have json tags! - Title string ` + "`json:" + `"title"` + "`" + ` - Content string ` + "`json:" + `"content"` + "`" + ` - Author string ` + "`json:" + `"author"` + "`" + ` - Picture string ` + "`json:" + `"picture"` + "`" + ` - Category []string ` + "`json:" + `"category"` + "`" + ` - ThemeStyle string ` + "`json:" + `"theme"` + "`" + ` + Title string ` + "`json:" + `"title"` + "`" + ` + Content string ` + "`json:" + `"content"` + "`" + ` + Author string ` + "`json:" + `"author"` + "`" + ` + Photo string ` + "`json:" + `"picture"` + "`" + ` + Category []string ` + "`json:" + `"category"` + "`" + ` + Theme string ` + "`json:" + `"theme"` + "`" + ` } func init() { @@ -101,7 +101,6 @@ func ({{ .initial }} *{{ .name }}) Editor() *editor.Editor { return &{{ .initial // MarshalEditor writes a buffer of html to edit a {{ .name }} and partially implements editor.Editable 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 @@ -127,22 +126,18 @@ func ({{ .initial }} *{{ .name }}) MarshalEditor() ([]byte, error) { }), }, editor.Field{ - View: editor.File("Picture", {{ .initial }}, map[string]string{ + View: editor.File("Photo", {{ .initial }}, map[string]string{ "label": "Author Photo", "placeholder": "Upload a profile picture for the author", }), }, editor.Field{ - View: editor.Checkbox("Category", {{ .initial }}, map[string]string{ + View: editor.Tags("Category", {{ .initial }}, map[string]string{ "label": "{{ .name }} Category", - }, map[string]string{ - "important": "Important", - "active": "Active", - "unplanned": "Unplanned", }), }, editor.Field{ - View: editor.Select("ThemeStyle", {{ .initial }}, map[string]string{ + View: editor.Select("Theme", {{ .initial }}, map[string]string{ "label": "Theme Style", }, map[string]string{ "dark": "Dark", |