summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorGravatar Andy Wingo2008-04-23 14:02:07 +0200
committerGravatar Andy Wingo2008-04-23 14:02:07 +0200
commitd52865f0371f7bffe11f935c97265fc60b8fdf77 (patch)
tree446c44c51dcba034ded9aec0a0943e5c7c01222e
parent3a7ddef4671260822d81d7052cadb5b1479ad0b0 (diff)
downloadtekuti-d52865f0371f7bffe11f935c97265fc60b8fdf77.tar.gz
tekuti-d52865f0371f7bffe11f935c97265fc60b8fdf77.zip
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.
-rw-r--r--tekuti/boot.scm8
-rw-r--r--tekuti/config.scm6
-rw-r--r--tekuti/template.scm18
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"))))))