summaryrefslogtreecommitdiff
path: root/cmd/ponzu/options.go
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2016-10-26 00:44:43 -0700
committerSteve Manuel <nilslice@gmail.com>2016-10-26 00:44:43 -0700
commit3dbc41fbbe547092604b51c6f26261dce05eab26 (patch)
tree1afb6c795155a9e9d5913b4aed0547ad067b4e76 /cmd/ponzu/options.go
parentc81783e87070340701a818eaae59f2304f982f3f (diff)
changing arrangement of default and generated post / content type
Diffstat (limited to 'cmd/ponzu/options.go')
-rw-r--r--cmd/ponzu/options.go39
1 files changed, 20 insertions, 19 deletions
diff --git a/cmd/ponzu/options.go b/cmd/ponzu/options.go
index 6f42f0c..468a447 100644
--- a/cmd/ponzu/options.go
+++ b/cmd/ponzu/options.go
@@ -80,25 +80,6 @@ type {{ .name }} struct {
Theme string ` + "`json:" + `"theme"` + "`" + `
}
-func init() {
- Types["{{ .name }}"] = func() interface{} { return new({{ .name }}) }
-}
-
-// SetContentID partially implements editor.Editable
-func ({{ .initial }} *{{ .name }}) SetContentID(id int) { {{ .initial }}.ID = id }
-
-// ContentID partially implements editor.Editable
-func ({{ .initial }} *{{ .name }}) ContentID() int { return {{ .initial }}.ID }
-
-// ContentName partially implements editor.Editable
-func ({{ .initial }} *{{ .name }}) ContentName() string { return {{ .initial }}.Title }
-
-// SetSlug partially implements editor.Editable
-func ({{ .initial }} *{{ .name }}) SetSlug(slug string) { {{ .initial }}.Slug = slug }
-
-// Editor partially implements editor.Editable
-func ({{ .initial }} *{{ .name }}) Editor() *editor.Editor { return &{{ .initial }}.editor }
-
// MarshalEditor writes a buffer of html to edit a {{ .name }} and partially implements editor.Editable
func ({{ .initial }} *{{ .name }}) MarshalEditor() ([]byte, error) {
view, err := editor.Form({{ .initial }},
@@ -152,6 +133,26 @@ func ({{ .initial }} *{{ .name }}) MarshalEditor() ([]byte, error) {
return view, nil
}
+
+func init() {
+ Types["{{ .name }}"] = func() interface{} { return new({{ .name }}) }
+}
+
+// SetContentID partially implements editor.Editable
+func ({{ .initial }} *{{ .name }}) SetContentID(id int) { {{ .initial }}.ID = id }
+
+// ContentID partially implements editor.Editable
+func ({{ .initial }} *{{ .name }}) ContentID() int { return {{ .initial }}.ID }
+
+// ContentName partially implements editor.Editable
+func ({{ .initial }} *{{ .name }}) ContentName() string { return {{ .initial }}.Title }
+
+// SetSlug partially implements editor.Editable
+func ({{ .initial }} *{{ .name }}) SetSlug(slug string) { {{ .initial }}.Slug = slug }
+
+// Editor partially implements editor.Editable
+func ({{ .initial }} *{{ .name }}) Editor() *editor.Editor { return &{{ .initial }}.editor }
+
`
func newProjectInDir(path string) error {