/
link-post.scm
39 lines (36 loc) · 1.93 KB
/
link-post.scm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
;; +--------------------------------------------------------------------------+
;; +-+----------------------------------------------------------------------+-+
;; +-| LINK POSTS |-+
;; +-| TYPE TAG: link |-+
;; +-+----------------------------------------------------------------------+-+
;; +-| POST TAGS |-+
;; +-| - type |-+
;; +-| - date |-+
;; +-| - link |-+
;; +-| - title |-+
;; +-| - desc |-+
;; +-| - tags |-+
;; +-+----------------------------------------------------------------------+-+
;; +-| For posting images as the body of the post with nothing else; the |-+
;; +-| title and date are included as one might expect. |-+
;; +-+----------------------------------------------------------------------+-+
;; +--------------------------------------------------------------------------+
(define parse-link-post
(lambda (post)
(let* ((date (extract-date post))
(title (extract-title post))
(link (extract-tag 'link post))
(desc (extract-tag 'desc post)))
(string-append
(make-content-div (link-body title link desc))
"<div align=\"left\">"
(parse-date date)
"</div>"
))))
(define link-body
(lambda (title link desc)
(string-append "<u><a href=\"" link "\">" (make-title title) "</a></u>\n\n"
"<i>"
desc
"</i>\n\n")))
(set! post-types (cons `(link . ,parse-link-post) post-types))