aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Brannon <chris@the-brannons.com>2021-03-31 08:07:20 -0700
committerChristopher Brannon <chris@the-brannons.com>2021-03-31 08:07:20 -0700
commita6449e5c651e5fc9fa929eefab62ab8e5b6e4397 (patch)
treea9749b4f03b2b32998f6499c50ef9036aefefd72
parent7541a31d4980297f425b1ce0a9378fe208eae9ce (diff)
downloadnawp-a6449e5c651e5fc9fa929eefab62ab8e5b6e4397.tar
nawp-a6449e5c651e5fc9fa929eefab62ab8e5b6e4397.tar.gz
nawp-a6449e5c651e5fc9fa929eefab62ab8e5b6e4397.tar.bz2
nawp-a6449e5c651e5fc9fa929eefab62ab8e5b6e4397.tar.lz
nawp-a6449e5c651e5fc9fa929eefab62ab8e5b6e4397.tar.xz
nawp-a6449e5c651e5fc9fa929eefab62ab8e5b6e4397.tar.zst
nawp-a6449e5c651e5fc9fa929eefab62ab8e5b6e4397.zip
Bugfixes.
-rwxr-xr-xnawp.scm8
1 files changed, 4 insertions, 4 deletions
diff --git a/nawp.scm b/nawp.scm
index 5da4456..5c6c214 100755
--- a/nawp.scm
+++ b/nawp.scm
@@ -146,8 +146,8 @@
(define (min-post-id)
(let ((res
- ((db-queryer db-file) "SELECT min(id) as m FROM posts;")))
- (if (pair? res) (assoc 'm (car res)) 0)))
+ ((db-queryer db-file) "SELECT min(id) as m FROM blog_entries;")))
+ (if (pair? res) (cdr (assoc 'm (car res))) 0)))
(define (latest-sxhtml #!key before)
(receive (posts stop-offset)
@@ -155,7 +155,7 @@
(fetch-latest-posts before)
(and (pair? it) (list-min (map post-id it))))
(let ((older-link
- (if (and stop-offset (> stop-offset (min-post-id))) (list (make-ahref (sprintf "?before=~s" stop-offset) "Older")) '())))
+ (if (and stop-offset (> stop-offset (min-post-id))) (list (make-ahref (sprintf "?before=~s" stop-offset) "Older")) '())))
(write-html-page
blog-title blog-description (uri->string blog-base-uri)
(uri->string feed-uri)
@@ -198,7 +198,7 @@
(apply make-post
(map
(lambda (field) (aand (assoc field row) (cdr it)))
- '(title timestamp slug title author body))))
+ '(id timestamp slug title author body))))
(define (fetch-latest-posts #!key before)
;; What I really want here is a composable sexp representation of SQL.