diff options
author | rekado <rekado@elephly.net> | 2016-01-17 12:53:42 +0100 |
---|---|---|
committer | rekado <rekado@elephly.net> | 2016-01-17 12:53:42 +0100 |
commit | 5850869f2637fe8df7f4ec08c9c4a87edec2025f (patch) | |
tree | 4c3e2f9902da32280dec4ad6134d9fb2ecebdd83 /haunt.scm | |
parent | b35c977dd898cb92c973fadc38cb2a50f6338832 (diff) |
move custom skribe stuff to skribe-utils.scm
Diffstat (limited to 'haunt.scm')
-rw-r--r-- | haunt.scm | 52 |
1 files changed, 0 insertions, 52 deletions
@@ -32,58 +32,6 @@ '(a blockquote p img h1 h2 h3 code pre strong em ul li dl dt dd)) -(define (email address) - "Obfuscate a given email ADDRESS." - `(span (@ (class "obfuscated")) - ,(string-map (lambda (c) (integer->char (+ 1 (char->integer c)))) - address))) - -(define (~) - "Non-breaking space." - (string #\240)) - -(define* (table #:key (align '()) headers rows) - "Build HTML tables more easily." - (let ((alignment (append align - (make-list (- (length headers) - (length align)) - "left")))) - (define (make-row fields) - `(tr ,(map (match-lambda - ((field alignment) - `(td (@ (align ,alignment)) ,field))) - (zip fields alignment)))) - (define (make-header fields) - `(tr (@ (class "header")) - ,(map (match-lambda - ((field alignment) - `(th (@ (align ,alignment)) ,field))) - (zip fields alignment)))) - `(table - (thead ,(make-header headers)) - (tbody ,(map make-row rows))))) - -(define (lyrics . contents) - `(pre (@ (class "lyrics")) ,contents)) - -(define (ref url text) - `(a (@ (href ,url)) ,text)) - -(define (figure file caption) - `(div (@ (class "figure")) - (img (@ (src ,(if (string-prefix? "/" file) - file - (string-append "/images/posts/" file))) - (alt ,caption))) - (p (@ (class "caption")) ,caption))) - -(define (wide-img file alt) - `(img (@ (class "full stretch") - (src ,(if (string-prefix? "/" file) - file - (string-append "/images/posts/" file))) - (alt ,alt)))) - (define (photo-snippet post) (let ((meta (post-ref post 'photo))) (if meta |