repos / pico

pico services - prose.sh, pastes.sh, imgs.sh, feeds.sh, pgs.sh
git clone https://github.com/picosh/pico.git

commit
0d7a174
parent
c2c7dc0
author
Eric Bower
date
2023-01-21 17:03:21 +0000 UTC
feat(feeds): add description to feeds
2 files changed,  +9, -6
M feeds/cron.go
+8, -6
 1@@ -29,9 +29,10 @@ func (c *UserAgentTransport) RoundTrip(r *http.Request) (*http.Response, error)
 2 }
 3 
 4 type FeedItem struct {
 5-	Title   string
 6-	Link    string
 7-	Content html.HTML
 8+	Title       string
 9+	Link        string
10+	Content     html.HTML
11+	Description html.HTML
12 }
13 
14 type Feed struct {
15@@ -215,9 +216,10 @@ func (f *Fetcher) Fetch(fp *gofeed.Parser, url string, lastDigest *time.Time) (*
16 		}
17 
18 		items = append(items, &FeedItem{
19-			Title:   item.Title,
20-			Link:    item.Link,
21-			Content: html.HTML(item.Content),
22+			Title:       item.Title,
23+			Link:        item.Link,
24+			Content:     html.HTML(item.Content),
25+			Description: html.HTML(item.Description),
26 		})
27 	}
28 
M feeds/html/digest.page.tmpl
+1, -0
1@@ -30,6 +30,7 @@ img {
2     {{range .Items}}
3     <div>
4         <h1><a href="{{.Link}}">{{.Title}}</a></h1>
5+        <div>{{.Description}}</div>
6         <div>{{.Content}}</div>
7     </div>
8     <hr />