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)
24 (define (get-tags post)
25 (or (assoc-ref (post-metadata post) 'tags) '()))
27 (define (post-date-and-tags date tags)
28 (let ((div `(div (@ (class "date-and-tags"))
29 (time (@ (datetime ,(date->string date "~Y-~m-~dT~H:~M:~S")))
30 ,(date->string date "~Y-~m-~d")))))
31 (cond ((> (length tags) 0)
34 (span (@ (style "margin: 0 3px")) ⦿)
35 (span (@ (class "tags"))
40 `((a (@ (href ,(format #f "tags/~a.html" tag))) ,tag) ", "))
49 (lambda (site title body)
53 (meta (@ (charset "utf-8")))
54 (title ,(string-append title " - " (site-title site)))
55 (link (@ (rel "stylesheet") (href "https://fonts.googleapis.com/css?family=Merriweather+Sans:400,300,300italic,400italic,700,700italic,800,800italic|Merriweather:400,300,300italic,400italic,700,700italic,900,900italic|Source+Code+Pro:200,300,400,500,600,700,900")))
56 ,(stylesheet "application.min")
57 ,(stylesheet "pygments.min")
58 ,(stylesheet "custom")
59 (meta (@ (name "viewport") (content "width=device-width, initial-scale=1.0"))))
61 ,(let ((metadata (site-default-metadata site)))
62 `(div (@ (id "page-content"))
64 (nav (@ (role "navigation") (class "navigation-bar"))
65 (ul (@ (class "navigation-items left"))
66 (li (@ (id "blog-title-header"))
67 (a (@ (href "index.html"))
68 (h1 ,(assoc-ref metadata 'author)))))
69 (ul (@ (class "navigation-items center")))
70 (ul (@ (class "navigation-items right"))
72 `(li (a (@ (href ,(cdr page))) ,(car page))))
73 (assoc-ref metadata 'pages)))))
74 (section (@ (role "main"))
75 (div (@ (class "content") (class "col-md-12")) ,body))))))))
79 `((article (@ (class "inline"))
81 (h1 (@ (class "title")) ,(post-ref post 'title))
82 ,(post-date-and-tags (post-date post) (get-tags post)))
86 (lambda (site title posts prefix)
87 (define (post-uri post)
88 (string-append (or prefix "")
89 (site-post-slug site post) ".html"))
91 (define (get-paragraphs sxml count)
93 (lambda (e) (and (pair? e) (eq? (car e) 'p)))
95 (list-head pars (min count (length pars)))))
97 (define (post-summary post)
98 (or (post-ref post 'summary)
99 (get-paragraphs (cdr (post-sxml post)) 3)))
102 ,@(map (lambda (post)
103 `(article (@ (class "inline"))
105 (h2 (@ (class "title"))
106 (a (@ (href ,(post-uri post)))
107 ,(post-ref post 'title)))
108 ,(post-date-and-tags (post-date post) (get-tags post)))
110 (footer (@ (class "read-more"))
111 (a (@ (href ,(post-uri post))) "...read more..."))))
112 (posts/reverse-chronological posts))))))
121 `(("Home" "index.html" ,posts/reverse-chronological)))
123 (site #:title "Javier Sancho"
124 #:domain "jsancho.org"
126 '((author . "Javier Sancho")
127 (description . "Free Software Evangelist - Programmer")
128 (email . "jsf@jsancho.org")
129 (picture . "images/jsancho.jpg")
130 (pages . (("projects" . "http://git.jsancho.org/")
131 ("about me" . "about.html"))))
132 #:readers (list sxml-reader html-reader)
133 #:builders (list (blog #:theme flex-theme #:collections %collections)
137 (static-directory "images")
138 (static-directory "fonts")
139 (static-directory "css")))