summaryrefslogtreecommitdiff
path: root/haunt.scm
diff options
context:
space:
mode:
authorJakob L. Kreuze <zerodaysfordays@sdf.lonestar.org>2019-04-27 19:28:03 -0400
committerJakob L. Kreuze <zerodaysfordays@sdf.lonestar.org>2019-04-27 19:28:03 -0400
commit1d8c982f0b1b285e2609d2b15065d4512dcafe9b (patch)
treeaebf3600862e88175cd3c84dd6ea41c3142a72ea /haunt.scm
parentfb034a971cec6dfdf2b0b0a213f6278bf3017007 (diff)
Update 'first-paragraph to support ox-haunt output
Diffstat (limited to 'haunt.scm')
-rw-r--r--haunt.scm13
1 files changed, 7 insertions, 6 deletions
diff --git a/haunt.scm b/haunt.scm
index 25aadcd..07d23e3 100644
--- a/haunt.scm
+++ b/haunt.scm
@@ -67,12 +67,13 @@
(define (first-paragraph post)
(let loop ((sxml (post-sxml post))
(result '()))
- (match sxml
- (() (reverse result))
- ((or (('p ...) _ ...) (paragraph _ ...))
- (reverse (cons paragraph result)))
- ((head . tail)
- (loop tail (cons head result))))))
+ (when (eqv? (car sxml) 'article)
+ (match (cdr sxml)
+ (() (reverse result))
+ ((or (('p ...) _ ...) (paragraph _ ...))
+ (reverse (cons paragraph result)))
+ ((head . tail)
+ (loop tail (cons head result)))))))
(define jakob-theme
(theme #:name "jakob"