summaryrefslogtreecommitdiffstats
path: root/feed.scm
diff options
context:
space:
mode:
authorJan Tuomi <jans.tuomi@gmail.com>2024-03-26 15:21:51 +0200
committerJan Tuomi <jans.tuomi@gmail.com>2024-03-26 21:25:10 +0200
commitb5be88122ca11a2d43ef989904d4b96f72a306c8 (patch)
treee352de5e2a9fc00be0a74911f245130cc0c406f2 /feed.scm
parente18c5350969407c6fd09a15bce7d7c622929245f (diff)
Add RSS generation
Diffstat (limited to 'feed.scm')
-rw-r--r--feed.scm25
1 files changed, 21 insertions, 4 deletions
diff --git a/feed.scm b/feed.scm
index 546fcc6..de1d4ac 100644
--- a/feed.scm
+++ b/feed.scm
@@ -2,8 +2,25 @@
(import scheme
(chicken base)
(chicken format)
- atom)
+ (chicken file)
+ (chicken io)
+ (chicken process)
+ (chicken pathname)
+ utils)
- (define (generate-feed archive-dir)
- ;; TODO generate feed with https://wiki.call-cc.org/eggref/5/atom or pandoc-rss
- (printf "TODO generate-feed \"~A\"~%" archive-dir)))
+ (define (generate-feed archive-dir out-dir)
+ (define paths (glob (format "~A/*" archive-dir)))
+ (define output-port
+ (process "pandoc-rss"
+ (apply list "-s"
+ "-t" "jan's garden"
+ "-d" "RSS feed for Jan's personal digital garden"
+ "-l" "https://jan.systems"
+ "-f" "%s"
+ "-n" "en-GB"
+ "-c" "CC BY-SA 4.0"
+ "-w" "https://jan.systems"
+ paths)))
+ (define output (read-string #f output-port))
+ (with-output-to-file (make-pathname out-dir "feed.xml")
+ (λ () (print output)))))