summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorGravatar Tom Willemsen2012-09-09 01:26:33 +0200
committerGravatar Tom Willemsen2012-09-09 01:26:33 +0200
commitd66887ef56109fb9ae719cf68613ed6274a27deb (patch)
treec85499fa3d327f3ff2122cbe9d8a61c8758edacd
parentc32c4f62403985c83ed4efa6aca71d0db264fc06 (diff)
downloadtekuti-d66887ef56109fb9ae719cf68613ed6274a27deb.tar.gz
tekuti-d66887ef56109fb9ae719cf68613ed6274a27deb.zip
Add separate index page
Move the old blog list to `/blog/' * tekuti/config.scm (*index-content*): New configuration, SXML contents of the index page. Should be overridden in any usual way. * tekuti/page.scm (page-blog): Renamed from `page-index'. (page-index): New page. Just returns `*index-content*'. * tekuti/web.scm (choose-handler): Send `/blog/' to `page-blog'.
-rw-r--r--tekuti/config.scm5
-rw-r--r--tekuti/page.scm4
-rw-r--r--tekuti/web.scm1
3 files changed, 9 insertions, 1 deletions
diff --git a/tekuti/config.scm b/tekuti/config.scm
index dbccf8a..d050920 100644
--- a/tekuti/config.scm
+++ b/tekuti/config.scm
@@ -31,7 +31,7 @@
*private-host* *private-port* *private-path-base*
*bootstrap-base* *git-dir* *git* *debug* *admin-user*
*admin-pass* *css-file* *navbar-links* *navbar-infix*
- *title* *subtitle* *name*
+ *title* *subtitle* *name* *index-content*
*server-impl* *server-impl-args*))
(define *public-host* "127.0.0.1")
@@ -54,6 +54,9 @@
(define *title* "My blog")
(define *subtitle* "Just a blog, ok")
(define *name* "Joe Schmo")
+(define *index-content*
+ '((h1 "Hello, World!")
+ "I am here to show you something new."))
(define *server-impl* 'http)
(define *server-impl-args*
diff --git a/tekuti/page.scm b/tekuti/page.scm
index 75ef70f..a0bd037 100644
--- a/tekuti/page.scm
+++ b/tekuti/page.scm
@@ -48,6 +48,7 @@
page-admin-change
page-admin-revert-change
page-index
+ page-blog
page-show-post
page-new-comment
page-archives
@@ -185,6 +186,9 @@
#:redirect (relurl '("admin")))))))
(define (page-index request body index)
+ (respond *index-content*))
+
+(define (page-blog request body index)
(respond `((div (@ (class "row"))
(div (@ (class "span9"))
,@(map (lambda (post)
diff --git a/tekuti/web.scm b/tekuti/web.scm
index faabcb7..57b8424 100644
--- a/tekuti/web.scm
+++ b/tekuti/web.scm
@@ -49,6 +49,7 @@
((GET admin changes sha1!) page-admin-change)
((POST admin revert-change sha1!) page-admin-revert-change)
((GET) page-index)
+ ((GET blog) page-blog)
((GET archives year? month? day?) page-archives)
((GET archives year! month! day! post!) page-show-post)
((POST archives year! month! day! post!) page-new-comment)