Browse Source

Support setting categories on posts

main
Matt Baer 2 years ago
parent
commit
89c047d266
2 changed files with 10 additions and 1 deletions
  1. +8
    -0
      category.go
  2. +2
    -1
      post.go

+ 8
- 0
category.go View File

@@ -0,0 +1,8 @@
package writeas

// Category represents a post tag with additional metadata, like a title and slug.
type Category struct {
Hashtag string `json:"hashtag"`
Slug string `json:"slug"`
Title string `json:"title"`
}

+ 2
- 1
post.go View File

@@ -52,7 +52,8 @@ type (
IsRTL *bool `json:"rtl,omitempty"`
Language *string `json:"lang,omitempty"`

AuthorSlug *string `json:"author"`
AuthorSlug *string `json:"author,omitempty"`
Categories []Category `json:"categories,omitempty"`

// Parameters only for creating
Crosspost []map[string]string `json:"crosspost,omitempty"`


Loading…
Cancel
Save