Skip to content

Commit

Permalink
Add Category.IsCategory field
Browse files Browse the repository at this point in the history
  • Loading branch information
thebaer committed Sep 14, 2023
1 parent 5a77fdf commit e313cb0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions category/category.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ type Category struct {
Slug string `json:"slug"`
Title string `json:"title"`
PostCount int64 `json:"post_count"`

// IsCategory distinguishes this Category from a mere tag. If true, it is often prominently featured on a blog,
// and looked up via its Slug instead of its Hashtag. It usually has all metadata, such as Title, correctly
// populated.
IsCategory bool `json:"-"`
}

// NewCategory creates a Category you can insert into the database, based on a hashtag. It automatically breaks up the
Expand Down

0 comments on commit e313cb0

Please sign in to comment.