diff options
Diffstat (limited to 'vendor')
-rw-r--r-- | vendor/github.com/gorilla/feeds/feed.go | 1 | ||||
-rw-r--r-- | vendor/github.com/gorilla/feeds/rss.go | 17 | ||||
-rw-r--r-- | vendor/modules.txt | 2 |
3 files changed, 15 insertions, 5 deletions
diff --git a/vendor/github.com/gorilla/feeds/feed.go b/vendor/github.com/gorilla/feeds/feed.go index 790a1b6ce..929c226c0 100644 --- a/vendor/github.com/gorilla/feeds/feed.go +++ b/vendor/github.com/gorilla/feeds/feed.go @@ -32,6 +32,7 @@ type Item struct { Author *Author Description string // used as description in rss, summary in atom Id string // used as guid in rss, id in atom + IsPermaLink string // an optional parameter for guid in rss Updated time.Time Created time.Time Enclosure *Enclosure diff --git a/vendor/github.com/gorilla/feeds/rss.go b/vendor/github.com/gorilla/feeds/rss.go index 8c227a8b7..9326cef8b 100644 --- a/vendor/github.com/gorilla/feeds/rss.go +++ b/vendor/github.com/gorilla/feeds/rss.go @@ -74,9 +74,9 @@ type RssItem struct { Category string `xml:"category,omitempty"` Comments string `xml:"comments,omitempty"` Enclosure *RssEnclosure - Guid string `xml:"guid,omitempty"` // Id used - PubDate string `xml:"pubDate,omitempty"` // created or updated - Source string `xml:"source,omitempty"` + Guid *RssGuid // Id used + PubDate string `xml:"pubDate,omitempty"` // created or updated + Source string `xml:"source,omitempty"` } type RssEnclosure struct { @@ -87,6 +87,13 @@ type RssEnclosure struct { Type string `xml:"type,attr"` } +type RssGuid struct { + //RSS 2.0 <guid isPermaLink="true">http://inessential.com/2002/09/01.php#a2</guid> + XMLName xml.Name `xml:"guid"` + Id string `xml:",chardata"` + IsPermaLink string `xml:"isPermaLink,attr,omitempty"` // "true", "false", or an empty string +} + type Rss struct { *Feed } @@ -96,9 +103,11 @@ func newRssItem(i *Item) *RssItem { item := &RssItem{ Title: i.Title, Description: i.Description, - Guid: i.Id, PubDate: anyTimeFormat(time.RFC1123Z, i.Created, i.Updated), } + if i.Id != "" { + item.Guid = &RssGuid{Id: i.Id, IsPermaLink: i.IsPermaLink} + } if i.Link != nil { item.Link = i.Link.Href } diff --git a/vendor/modules.txt b/vendor/modules.txt index e3f7cb4c0..140759020 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -362,7 +362,7 @@ github.com/gorilla/context # github.com/gorilla/css v1.0.0 ## explicit github.com/gorilla/css/scanner -# github.com/gorilla/feeds v1.1.2 +# github.com/gorilla/feeds v1.2.0 ## explicit; go 1.20 github.com/gorilla/feeds # github.com/gorilla/handlers v1.5.2 |