1
0
Fork 0

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.
This commit is contained in:
Andy Wingo 2008-04-23 14:02:07 +02:00
parent 3a7ddef467
commit d52865f037
3 changed files with 23 additions and 9 deletions

View file

@ -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)

View file

@ -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")

View file

@ -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"))))))