Add preliminary RSS feed
This commit is contained in:
parent
fcc82d08ca
commit
0df3fc385c
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,4 +3,5 @@ src/**/*.css
|
||||
**/compiled/*
|
||||
src/**/*.js
|
||||
src/**/*.md
|
||||
src/**/*.xml
|
||||
out/
|
40
src/blog/feed.xml.pp
Normal file
40
src/blog/feed.xml.pp
Normal file
@ -0,0 +1,40 @@
|
||||
#lang pollen
|
||||
◊(require pollen/core
|
||||
pollen/pagetree
|
||||
pollen/file
|
||||
racket/path
|
||||
racket/string)
|
||||
|
||||
◊(define here-path (select-from-metas 'here-path metas))
|
||||
|
||||
◊(define ptree (get-pagetree (build-path
|
||||
(path-only (string->path here-path))
|
||||
'up
|
||||
"index.ptree")))
|
||||
|
||||
◊(current-pagetree ptree)
|
||||
|
||||
◊(define (render-item item)
|
||||
(let ((src (get-source (path->string (path->complete-path (symbol->string item))))))
|
||||
(format
|
||||
"<item>
|
||||
<title>~a</title>
|
||||
<link>~a</link>
|
||||
</item>"
|
||||
(select 'h1 src)
|
||||
(format "https://jeremydormitzer.com/blog/~a" item))))
|
||||
|
||||
◊(define (render-items items)
|
||||
(string-join (map render-item items) "\n"))
|
||||
|
||||
<rss version="2.0">
|
||||
<channel>
|
||||
<title>Jeremy Dormitzer's blog</title>
|
||||
<link>https://jeremydormitzer.com/blog</link>
|
||||
<description>Programming and general geekiness from Jeremy Dormitzer.</description>
|
||||
<language>en-us</language>
|
||||
<copyright>© Jeremy Dormitzer 2019</copyright>
|
||||
<ttl>60</ttl>
|
||||
◊(render-items (children 'blog))
|
||||
</channel>
|
||||
</rss>
|
Loading…
Reference in New Issue
Block a user