From d52865f0371f7bffe11f935c97265fc60b8fdf77 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Wed, 23 Apr 2008 14:02:07 +0200 Subject: dewingoize * tekuti/boot.scm (boot): Add config option, a file evaluated inside (tekuti config). * tekuti/config.scm: Add *css-file*, *navbar-links*, *navbar-infix*. Change default admin pass. * tekuti/template.scm (templatize): Make the default template less wingo-specific. --- tekuti/boot.scm | 8 ++++++++ tekuti/config.scm | 6 +++++- tekuti/template.scm | 18 ++++++++++-------- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/tekuti/boot.scm b/tekuti/boot.scm index e06713b..627cfdf 100644 --- a/tekuti/boot.scm +++ b/tekuti/boot.scm @@ -38,6 +38,7 @@ (define *option-grammar* '((gds) (usage) (repl) + (config (value #t) (single-char #\c)) (version (single-char #\v)) (help (single-char #\h)))) @@ -76,6 +77,13 @@ (define (boot args) (let ((options (parse-options args))) + (let ((config (option-ref options 'config #f))) + (if config + (let ((config-module (resolve-module '(tekuti config)))) + (save-module-excursion + (lambda () + (set-current-module config-module) + (primitive-load config)))))) (ensure-git-repo) (if (option-ref options 'repl #f) (begin (make-thread event-loop) diff --git a/tekuti/config.scm b/tekuti/config.scm index 56b6952..027f23c 100644 --- a/tekuti/config.scm +++ b/tekuti/config.scm @@ -28,6 +28,7 @@ #:use-module (tekuti util) #:export (*host* *port* *backlog* *git-dir* *git* *public-url-base* *private-url-base* *debug* *admin-user* *admin-pass* + *css-file* *navbar-links* *navbar-infix* *title* *subtitle* *name*)) (define *host* "127.0.0.1") @@ -37,9 +38,12 @@ (define *git* "git") (define *public-url-base* "/blog/") (define *private-url-base* "/blog/") +(define *css-file* "/base.css") +(define *navbar-links* '()) +(define *navbar-infix* " ") (define *debug* #t) (define *admin-user* "admin") -(define *admin-pass* "totingiini") +(define *admin-pass* "admin") (define *title* "My blog") (define *subtitle* "Just a blog, ok") (define *name* "Joe Schmo") diff --git a/tekuti/template.scm b/tekuti/template.scm index 2117034..9185b8e 100644 --- a/tekuti/template.scm +++ b/tekuti/template.scm @@ -39,11 +39,13 @@ (cond ((null? in) (reverse out)) (else (lp (cdr in) (cons* (car in) infix out))))))) (define (make-navbar) - `(div (@ (id "navbar")) - ,@(list-join - (map (lambda (x) `(a (@ ,(href x "/")) ,x)) - '("about" "software" "writings" "photos")) - " | "))) + (if (null? *navbar-links*) + '() + `((div (@ (id "navbar")) + ,@(list-join + (map (lambda (x) `(a (@ (href ,(cdr x))) ,(car x))) + *navbar-links*) + *navbar-infix*))))) `(html (head (title ,(rref request 'title *title*)) (meta (@ (name "Generator") @@ -51,15 +53,15 @@ (link (@ (rel "stylesheet") (type "text/css") (media "screen") - (href "/base.css")))) ;fixme + (href ,*css-file*)))) (body (div (@ (id "rap")) (h1 (@ (id "header")) (a (@ ,(href "")) ,*title*)) - ,(make-navbar) + ,@(make-navbar) (div (@ (id "content")) ,@(rref request 'body '((p "(missing content?)")))) (div (@ (id "footer")) "powered by " (a (@ (href "http://wingolog.org/software/tekuti/")) - "parentheses")))))) + "tekuti")))))) -- cgit v1.2.3-54-g00ecf