|
|
|
@ -1,5 +1,5 @@ |
|
|
|
|
/* |
|
|
|
|
* Copyright © 2018-2020 A Bunch Tell LLC. |
|
|
|
|
* Copyright © 2018-2021 A Bunch Tell LLC. |
|
|
|
|
* |
|
|
|
|
* This file is part of WriteFreely. |
|
|
|
|
* |
|
|
|
@ -15,7 +15,7 @@ import ( |
|
|
|
|
"net/http" |
|
|
|
|
"time" |
|
|
|
|
|
|
|
|
|
. "github.com/gorilla/feeds" |
|
|
|
|
"github.com/gorilla/feeds" |
|
|
|
|
"github.com/gorilla/mux" |
|
|
|
|
stripmd "github.com/writeas/go-strip-markdown/v2" |
|
|
|
|
"github.com/writeas/web-core/log" |
|
|
|
@ -87,11 +87,11 @@ func ViewFeed(app *App, w http.ResponseWriter, req *http.Request) error { |
|
|
|
|
siteURL += "tag:" + tag |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
feed := &Feed{ |
|
|
|
|
feed := &feeds.Feed{ |
|
|
|
|
Title: collectionTitle, |
|
|
|
|
Link: &Link{Href: siteURL}, |
|
|
|
|
Link: &feeds.Link{Href: siteURL}, |
|
|
|
|
Description: coll.Description, |
|
|
|
|
Author: &Author{author, ""}, |
|
|
|
|
Author: &feeds.Author{author, ""}, |
|
|
|
|
Created: time.Now(), |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -103,13 +103,13 @@ func ViewFeed(app *App, w http.ResponseWriter, req *http.Request) error { |
|
|
|
|
// Create the item for the feed
|
|
|
|
|
title = p.PlainDisplayTitle() |
|
|
|
|
permalink = fmt.Sprintf("%s%s", baseUrl, p.Slug.String) |
|
|
|
|
feed.Items = append(feed.Items, &Item{ |
|
|
|
|
feed.Items = append(feed.Items, &feeds.Item{ |
|
|
|
|
Id: fmt.Sprintf("%s%s", basePermalinkUrl, p.Slug.String), |
|
|
|
|
Title: title, |
|
|
|
|
Link: &Link{Href: permalink}, |
|
|
|
|
Link: &feeds.Link{Href: permalink}, |
|
|
|
|
Description: "<![CDATA[" + stripmd.Strip(p.Content) + "]]>", |
|
|
|
|
Content: string(p.HTMLContent), |
|
|
|
|
Author: &Author{author, ""}, |
|
|
|
|
Author: &feeds.Author{author, ""}, |
|
|
|
|
Created: p.Created, |
|
|
|
|
Updated: p.Updated, |
|
|
|
|
}) |
|
|
|
|