summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2022-07-05 20:19:45 -0400
committerDavid Thompson <dthompson2@worcester.edu>2022-07-07 22:00:06 -0400
commit30d22f2f068b65a0dd4fa4b811c6cce3b3cb4c96 (patch)
treed00b0dae854cca5ba43d252b3827539c5c867cfa
parent2ac650f5be1d9e5f826145c32a8c82dbfb4b7e29 (diff)
builder: rss: Refactor using site-url.wip-slug-to-file-name
-rw-r--r--haunt/builder/rss.scm12
1 files changed, 3 insertions, 9 deletions
diff --git a/haunt/builder/rss.scm b/haunt/builder/rss.scm
index 93c65c5..dda47b7 100644
--- a/haunt/builder/rss.scm
+++ b/haunt/builder/rss.scm
@@ -36,7 +36,6 @@
#:use-module (haunt serve mime-types)
#:use-module (haunt builder atom)
#:use-module (haunt builder blog)
- #:use-module (web uri)
#:export (rss-feed))
;; Reader beware: this isn't as nice as atom.scm, because rss isn't
@@ -54,12 +53,7 @@
(define* (post->rss-item site slug->file-name post)
"Convert POST into an RSS <item> node."
- (let ((uri (uri->string
- (build-uri (site-scheme site)
- #:host (site-domain site)
- #:path (string-append "/"
- (slug->file-name
- (site-post-slug site post)))))))
+ (let ((url (site-url site (slug->file-name (site-post-slug site post)))))
`(item
(title ,(post-ref post 'title))
;; Looks like: <author>lawyer@boyer.net (Lawyer Boyer)</author>
@@ -71,8 +65,8 @@
`((author ,email)))
(else '())))
(pubDate ,(date->rfc822-str (post-date post)))
- (guid ,uri)
- (link ,uri)
+ (guid ,url)
+ (link ,url)
(description ,(sxml->html-string (post-sxml post)))
,@(map (lambda (enclosure)
`(enclosure (@ (title ,(enclosure-title enclosure))