Skip to content

Commit

Permalink
Omit PDF link when source is not in “posts” folder. Closes #7
Browse files Browse the repository at this point in the history
  • Loading branch information
otherjoel committed Mar 30, 2019
1 parent b48552d commit 8e54641
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions util-template.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,17 @@
,(pubdate->english timestamp-raw))
nbsp middot nbsp)]
[else '("")]))

(define pdflink
(cond [(string-prefix? (symbol->string post) "posts")
`((a [[class "pdf"]
[href ,(string-append "/posts/" (pdfname (select-from-metas 'here-path metas)))]]
"PDF") nbsp middot nbsp)]
[else '("")]))
`(header
(h1 (a [[href ,(string-append "/" (symbol->string post))]] ,(select-from-metas 'title metas)))
(p ,@timestamp
,@updated-xexpr
(a [[class "pdf"]
[href ,(string-append "/posts/" (pdfname (select-from-metas 'here-path metas)))]]
"PDF")
nbsp middot nbsp
,@pdflink
(a [[class "source-link"] [href ,(source-listing post)]]
loz "Pollen" nbsp "source"))
,topics-xexpr))
Expand Down

0 comments on commit 8e54641

Please sign in to comment.