[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] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
dependabot[bot]
2023-12-05 11:45:33 +01:00
committed by GitHub
parent 5556767ff7
commit bffc67d764
13 changed files with 154 additions and 103 deletions

View File

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