Skip to content

Commit 4dac709

Browse files
committed
Include link references to feeds in head
1 parent 0aec8ae commit 4dac709

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

blog/build/render/page.rkt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"util.rkt")
1515

1616
(provide (contract-out
17-
[page (-> #:title string? #:body xexpr/c xexpr/c)]
17+
[page (->* [#:title string? #:body xexpr/c] [#:tag (or/c string? #f)] xexpr/c)]
1818
[post-page (-> rendered-post? xexpr/c)]
1919
[index-page-title (->* [] [#:tag (or/c string? #f)] string?)]
2020
[index-page (->i ([total-pages (and/c exact-integer? (>=/c 1))]
@@ -23,7 +23,7 @@
2323
(#:tag [tag (or/c string? #f)])
2424
[result xexpr/c])]))
2525

26-
(define (page #:title title #:body body)
26+
(define (page #:title title #:body body #:tag [tag #f])
2727
`(html
2828
(head
2929
(meta ([charset "utf-8"]))
@@ -35,6 +35,8 @@
3535
"|Fira+Code:300,400,500,600,700"))
3636
,(stylesheet "/css/application.min.css")
3737
,(stylesheet "/css/pygments.min.css")
38+
(link ([rel "alternate"] [type "application/atom+xml"] [title "Atom Feed"] [href ,(feed-path 'atom #:tag tag)]))
39+
(link ([rel "alternate"] [type "application/rss+xml"] [title "RSS Feed"] [href ,(feed-path 'rss #:tag tag)]))
3840
(body
3941
(header
4042
(nav ([role "navigation"] [class "navigation-bar"])
@@ -68,6 +70,7 @@
6870

6971
(define (index-page total-pages page-number posts #:tag [tag #f])
7072
(page #:title (index-page-title #:tag tag)
73+
#:tag tag
7174
#:body `(div ([class "content"])
7275
,@(when/list tag
7376
`(h1 ([class "tag-page-header"])

0 commit comments

Comments
 (0)