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 (li (a (@ (href "https://jsancho.org/")) "in spanish")))
71 (ul (@ (class "navigation-items right"))
73 `(li (a (@ (href ,(cdr page))) ,(car page))))
74 (assoc-ref metadata 'pages)))))
75 (section (@ (role "main"))
76 (div (@ (class "content") (class "col-md-12")) ,body))))))))
80 `((article (@ (class "inline"))
82 (h1 (@ (class "title")) ,(post-ref post 'title))
83 ,(post-date-and-tags (post-date post) (get-tags post)))
87 (lambda (site title posts prefix)
88 (define (post-uri post)
89 (string-append (or prefix "")
90 (site-post-slug site post) ".html"))
92 (define (get-paragraphs sxml count)
93 (define (getp sxml count res)
94 (cond ((or (= count 0) (null? sxml))
96 ((and (pair? (car sxml)) (eq? (caar sxml) 'p))
97 (getp (cdr sxml) (- count 1) (cons (car sxml) res)))
99 (getp (cdr sxml) count (cons (car sxml) res)))))
100 (reverse (getp sxml count '())))
102 (define (post-summary post)
103 (or (post-ref post 'summary)
104 (get-paragraphs (cdr (post-sxml post)) 3)))
107 ,@(map (lambda (post)
108 `(article (@ (class "inline"))
110 (h2 (@ (class "title"))
111 (a (@ (href ,(post-uri post)))
112 ,(post-ref post 'title)))
113 ,(post-date-and-tags (post-date post) (get-tags post)))
115 (footer (@ (class "read-more"))
116 (a (@ (href ,(post-uri post))) "...read more..."))))
117 (posts/reverse-chronological posts))))))
125 (header (h2 "About me"))
126 (img (@ (src "images/jsancho.jpg") (width "150") (height "150") (align "left") (style "margin: 10px;")))
127 (p "My name is Javier Sancho, and I am a programmer and a free software evangelist. I live in Castellón, Spain.")
128 (p "I met GNU/Linux and free software while I was studying Computer Science at " (a (@ (href "http://www.uji.es/")) "Universitat Jaume I") " and, since then, my commitment with these ideas hasn't stopped growing.")
129 (p "It was in 2003 when I started as an activist, participating in events related with free software, demonstrations against software patents, talks and information sessions at install parties, schools, etc.")
130 (p "I enjoy programming and I use the programming language that better fits my needs (Python, PHP, Golang, Erlang, ...). For many years my favorite language was C, although over time that privileged place has been occupied by Lisp y Scheme. I'm in love with the functional paradigm.")
131 (p "I'm married with a wonderful woman and we have a kid that amaze us every day. They are the best of my life.")
132 (p "Besides this blog, sometimes I share thoughts in " (a (@ (href "https://twitter.com/jsancho_gpl")) "Twitter") ". You can email me at " (a (@ (href "mailto:jsf@jsancho.org")) "jsf@jsancho.org") "."))))))
135 `(("Home" "index.html" ,posts/reverse-chronological)))
137 (site #:title "Javier Sancho"
138 #:domain "jsancho.org"
140 '((author . "Javier Sancho")
141 (description . "Free Software Evangelist - Programmer")
142 (email . "jsf@jsancho.org")
143 (picture . "images/jsancho.jpg")
144 (pages . (("projects" . "http://git.jsancho.org/")
145 ("about me" . "about.html"))))
146 #:readers (list sxml-reader html-reader)
147 #:builders (list (blog #:theme flex-theme #:collections %collections)
151 (static-directory "images")
152 (static-directory "fonts")
153 (static-directory "css")))