File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 35
35
(content ([type "html " ]) ,(xexpr->string `(article ,@body))))))]
36
36
37
37
['rss
38
- (define updated (post-date->string (rendered-post-date (first posts))))
38
+ (define updated (post-date->rfc-822-date (rendered-post-date (first posts))))
39
39
`(rss ([version "2.0 " ])
40
40
(channel
41
41
(title ,(index-page-title #:tag tag ))
50
50
(title ,title-str)
51
51
(link ,(full-url (rendered-post-path post)))
52
52
(guid ([isPermaLink "true " ]) ,(full-url (rendered-post-path post)))
53
- (pubDate ,(post-date->string date))
53
+ (pubDate ,(post-date->rfc-822-date date))
54
54
(description ,(xexpr->string `(article ,@body)))))))]))
55
55
56
56
(define (post-date->rfc-3339-datetime date)
57
57
(~a (post-date->string date) "T00:00:00Z " ))
58
+
59
+ ;; The RSS spec demands that dates be in this somewhat odd RFC 822 format, and
60
+ ;; this appears to be important for at least some actual RSS implementations;
61
+ ;; see lexi-lambda.github.io#10.
62
+ (define (post-date->rfc-822-date date)
63
+ (~a (~r (post-date-day date) #:min-width 2 #:pad-string "0 " )
64
+ " " (vector-ref #("Jan " "Feb " "Mar " "Apr " "May " "Jun " "Jul " "Aug " "Sep " "Oct " "Nov " "Dec " )
65
+ (sub1 (post-date-month date)))
66
+ " " (post-date-year date)))
You can’t perform that action at this time.
0 commit comments