Add authors to the rss feed
This commit is contained in:
parent
497a020f9a
commit
154867c50c
1 changed files with 6 additions and 0 deletions
|
@ -12,6 +12,7 @@ import (
|
|||
type rss struct {
|
||||
XMLName xml.Name `xml:"rss"`
|
||||
Version string `xml:"version,attr"`
|
||||
XmlnsDC string `xml:"xmlns:dc,attr"`
|
||||
Channel channel `xml:"channel"`
|
||||
}
|
||||
|
||||
|
@ -25,6 +26,7 @@ type channel struct {
|
|||
|
||||
type item struct {
|
||||
Title string `xml:"title"`
|
||||
Creator []string `xml:"dc:creator,omitempty"`
|
||||
Description string `xml:"description"`
|
||||
Link string `xml:"link"`
|
||||
GUID *guid `xml:"guid,omitempty"`
|
||||
|
@ -71,6 +73,7 @@ func newsRss(data interface{}) (rss, error) {
|
|||
|
||||
feed := rss{
|
||||
Version: "2.0",
|
||||
XmlnsDC: "http://purl.org/dc/elements/1.1/",
|
||||
Channel: channel{
|
||||
Title: news.S.Title,
|
||||
Description: "News of the library",
|
||||
|
@ -104,6 +107,7 @@ func searchRss(data interface{}) (rss, error) {
|
|||
|
||||
feed := rss{
|
||||
Version: "2.0",
|
||||
XmlnsDC: "http://purl.org/dc/elements/1.1/",
|
||||
Channel: channel{
|
||||
Title: search.S.Title,
|
||||
Description: description,
|
||||
|
@ -122,6 +126,7 @@ func listRss(data interface{}) (rss, error) {
|
|||
|
||||
feed := rss{
|
||||
Version: "2.0",
|
||||
XmlnsDC: "http://purl.org/dc/elements/1.1/",
|
||||
Channel: channel{
|
||||
Title: lb.S.Title,
|
||||
Description: strings.Join(lb.List.Description, "\n"),
|
||||
|
@ -138,6 +143,7 @@ func bookListRss(books []database.Book, baseURL string) []item {
|
|||
for i, b := range books {
|
||||
items[i] = item{
|
||||
Title: b.Title,
|
||||
Creator: b.Authors,
|
||||
Description: b.Description,
|
||||
Link: baseURL + "/download/" + b.ID,
|
||||
Category: b.Tags,
|
||||
|
|
Reference in a new issue