浏览代码

Support setting categories on posts

main
Matt Baer 2 年前
父节点
当前提交
89c047d266
共有 2 个文件被更改,包括 10 次插入1 次删除
  1. +8
    -0
      category.go
  2. +2
    -1
      post.go

+ 8
- 0
category.go 查看文件

@@ -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 查看文件

@@ -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"`


正在加载...
取消
保存