From bffc67d764221fa9c1ad3ad65702b3a157bb2d79 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Dec 2023 11:45:33 +0100 Subject: [chore]: Bump github.com/gorilla/feeds from 1.1.1 to 1.1.2 (#2414) Bumps [github.com/gorilla/feeds](https://github.com/gorilla/feeds) from 1.1.1 to 1.1.2. - [Release notes](https://github.com/gorilla/feeds/releases) - [Commits](https://github.com/gorilla/feeds/compare/v1.1.1...v1.1.2) --- updated-dependencies: - dependency-name: github.com/gorilla/feeds dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- vendor/github.com/gorilla/feeds/json.go | 41 +++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 17 deletions(-) (limited to 'vendor/github.com/gorilla/feeds/json.go') diff --git a/vendor/github.com/gorilla/feeds/json.go b/vendor/github.com/gorilla/feeds/json.go index 75a82fd62..ae5deb76d 100644 --- a/vendor/github.com/gorilla/feeds/json.go +++ b/vendor/github.com/gorilla/feeds/json.go @@ -6,7 +6,7 @@ import ( "time" ) -const jsonFeedVersion = "https://jsonfeed.org/version/1" +const jsonFeedVersion = "https://jsonfeed.org/version/1.1" // JSONAuthor represents the author of the feed or of an individual item // in the feed @@ -77,7 +77,8 @@ type JSONItem struct { BannerImage string `json:"banner_,omitempty"` PublishedDate *time.Time `json:"date_published,omitempty"` ModifiedDate *time.Time `json:"date_modified,omitempty"` - Author *JSONAuthor `json:"author,omitempty"` + Author *JSONAuthor `json:"author,omitempty"` // deprecated in JSON Feed v1.1, keeping for backwards compatibility + Authors []*JSONAuthor `json:"authors,omitempty"` Tags []string `json:"tags,omitempty"` Attachments []JSONAttachment `json:"attachments,omitempty"` } @@ -92,19 +93,21 @@ type JSONHub struct { // JSONFeed represents a syndication feed in the JSON Feed Version 1 format. // Matching the specification found here: https://jsonfeed.org/version/1. type JSONFeed struct { - Version string `json:"version"` - Title string `json:"title"` - HomePageUrl string `json:"home_page_url,omitempty"` - FeedUrl string `json:"feed_url,omitempty"` - Description string `json:"description,omitempty"` - UserComment string `json:"user_comment,omitempty"` - NextUrl string `json:"next_url,omitempty"` - Icon string `json:"icon,omitempty"` - Favicon string `json:"favicon,omitempty"` - Author *JSONAuthor `json:"author,omitempty"` - Expired *bool `json:"expired,omitempty"` - Hubs []*JSONItem `json:"hubs,omitempty"` - Items []*JSONItem `json:"items,omitempty"` + Version string `json:"version"` + Title string `json:"title"` + Language string `json:"language,omitempty"` + HomePageUrl string `json:"home_page_url,omitempty"` + FeedUrl string `json:"feed_url,omitempty"` + Description string `json:"description,omitempty"` + UserComment string `json:"user_comment,omitempty"` + NextUrl string `json:"next_url,omitempty"` + Icon string `json:"icon,omitempty"` + Favicon string `json:"favicon,omitempty"` + Author *JSONAuthor `json:"author,omitempty"` // deprecated in JSON Feed v1.1, keeping for backwards compatibility + Authors []*JSONAuthor `json:"authors,omitempty"` + Expired *bool `json:"expired,omitempty"` + Hubs []*JSONHub `json:"hubs,omitempty"` + Items []*JSONItem `json:"items,omitempty"` } // JSON is used to convert a generic Feed to a JSONFeed. @@ -139,9 +142,11 @@ func (f *JSON) JSONFeed() *JSONFeed { feed.HomePageUrl = f.Link.Href } if f.Author != nil { - feed.Author = &JSONAuthor{ + author := &JSONAuthor{ Name: f.Author.Name, } + feed.Author = author + feed.Authors = []*JSONAuthor{author} } for _, e := range f.Items { feed.Items = append(feed.Items, newJSONItem(e)) @@ -165,9 +170,11 @@ func newJSONItem(i *Item) *JSONItem { item.ExternalUrl = i.Source.Href } if i.Author != nil { - item.Author = &JSONAuthor{ + author := &JSONAuthor{ Name: i.Author.Name, } + item.Author = author + item.Authors = []*JSONAuthor{author} } if !i.Created.IsZero() { item.PublishedDate = &i.Created -- cgit v1.2.3