1 (use-modules (haunt asset)
14 (define (stylesheet name)
15 `(link (@ (rel "stylesheet")
16 (href ,(string-append "css/" name ".css")))))
18 (define (static-page title file-name body)
21 (with-layout flex-theme site title body)
27 (lambda (site title body)
31 (meta (@ (charset "utf-8")))
32 (title ,(string-append title " - " (site-title site)))
33 (link (@ (rel "stylesheet") (href "//fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700,400italic")))
34 ,(stylesheet "style.min")
35 ,(stylesheet "monokai.min")
36 ,(stylesheet "font-awesome.min")
37 ,(stylesheet "custom")
38 (meta (@ (name "viewport") (content "width=device-width, initial-scale=1.0"))))
40 ,(let ((metadata (site-default-metadata site)))
43 (a (@ (href "index.html")) (img (@ (src ,(assoc-ref metadata 'picture)))))
44 (h1 (a (@ (href "index.html")) ,(assoc-ref metadata 'author)))
45 (p ,(assoc-ref metadata 'description))
47 (ul (@ (class "list"))
49 `(li (a (@ (href ,(cdr page))) ,(car page))))
50 (assoc-ref metadata 'pages))))
51 (ul (@ (class "social"))
52 (li (a (@ (class "sc-twitter") (target "_blank") (href "https://twitter.com/jsancho_gpl")) (i (@ (class "fa fa-twitter")))))
54 (li (a (@ (class "sc-rss") (target "_blank") (href "feed.xml")) (i (@ (class "fa fa-rss")))))))))
59 (define (get-tags post)
60 (or (assoc-ref (post-metadata post) 'tags) '()))
62 `((article (@ (class "single"))
64 (h1 ,(post-ref post 'title))
65 (p "Posted on " ,(date->string (post-date post) "~B ~d, ~Y")))
67 (div (@ (class "tag-cloud"))
70 `((a (@ (href "")) ,tag) " "))
74 (lambda (site title posts prefix)
75 (define (post-uri post)
76 (string-append (or prefix "")
77 (site-post-slug site post) ".html"))
79 (define (get-paragraphs sxml count)
81 (lambda (e) (and (pair? e) (eq? (car e) 'p)))
83 (list-head pars (min count (length pars)))))
85 (define (post-summary post)
86 (or (post-ref post 'summary)
87 (get-paragraphs (cdr (post-sxml post)) 3)))
94 (a (@ (href ,(post-uri post)))
95 ,(post-ref post 'title)))
96 (p "Posted on " ,(date->string (post-date post) "~B ~d, ~Y")))
97 (div ,(post-summary post)
99 (a (@ (class "btn") (href ,(post-uri post))) " Continue reading "))
101 (posts/reverse-chronological posts))))))
110 `(("Home" "index.html" ,posts/reverse-chronological)))
112 (site #:title "Javier Sancho"
113 #:domain "jsancho.org"
115 '((author . "Javier Sancho")
116 (description . "Free Software Evangelist - Programmer")
117 (email . "jsf@jsancho.org")
118 (picture . "images/jsancho.jpg")
119 (pages . (("about" . "about.html")
120 ("projects" . "http://git.jsancho.org/"))))
121 #:readers (list sxml-reader html-reader)
122 #:builders (list (blog #:theme flex-theme #:collections %collections)
126 (static-directory "images")
127 (static-directory "fonts")
128 (static-directory "css")))