From d66887ef56109fb9ae719cf68613ed6274a27deb Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 9 Sep 2012 01:26:33 +0200 Subject: 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'. --- tekuti/config.scm | 5 ++++- tekuti/page.scm | 4 ++++ tekuti/web.scm | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) (limited to 'tekuti') 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) -- cgit v1.2.3-54-g00ecf