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:
parent
3a7ddef467
commit
d52865f037
3 changed files with 23 additions and 9 deletions
|
@ -38,6 +38,7 @@
|
||||||
(define *option-grammar* '((gds)
|
(define *option-grammar* '((gds)
|
||||||
(usage)
|
(usage)
|
||||||
(repl)
|
(repl)
|
||||||
|
(config (value #t) (single-char #\c))
|
||||||
(version (single-char #\v))
|
(version (single-char #\v))
|
||||||
(help (single-char #\h))))
|
(help (single-char #\h))))
|
||||||
|
|
||||||
|
@ -76,6 +77,13 @@
|
||||||
|
|
||||||
(define (boot args)
|
(define (boot args)
|
||||||
(let ((options (parse-options 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)
|
(ensure-git-repo)
|
||||||
(if (option-ref options 'repl #f)
|
(if (option-ref options 'repl #f)
|
||||||
(begin (make-thread event-loop)
|
(begin (make-thread event-loop)
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#:use-module (tekuti util)
|
#:use-module (tekuti util)
|
||||||
#:export (*host* *port* *backlog* *git-dir* *git* *public-url-base*
|
#:export (*host* *port* *backlog* *git-dir* *git* *public-url-base*
|
||||||
*private-url-base* *debug* *admin-user* *admin-pass*
|
*private-url-base* *debug* *admin-user* *admin-pass*
|
||||||
|
*css-file* *navbar-links* *navbar-infix*
|
||||||
*title* *subtitle* *name*))
|
*title* *subtitle* *name*))
|
||||||
|
|
||||||
(define *host* "127.0.0.1")
|
(define *host* "127.0.0.1")
|
||||||
|
@ -37,9 +38,12 @@
|
||||||
(define *git* "git")
|
(define *git* "git")
|
||||||
(define *public-url-base* "/blog/")
|
(define *public-url-base* "/blog/")
|
||||||
(define *private-url-base* "/blog/")
|
(define *private-url-base* "/blog/")
|
||||||
|
(define *css-file* "/base.css")
|
||||||
|
(define *navbar-links* '())
|
||||||
|
(define *navbar-infix* " ")
|
||||||
(define *debug* #t)
|
(define *debug* #t)
|
||||||
(define *admin-user* "admin")
|
(define *admin-user* "admin")
|
||||||
(define *admin-pass* "totingiini")
|
(define *admin-pass* "admin")
|
||||||
(define *title* "My blog")
|
(define *title* "My blog")
|
||||||
(define *subtitle* "Just a blog, ok")
|
(define *subtitle* "Just a blog, ok")
|
||||||
(define *name* "Joe Schmo")
|
(define *name* "Joe Schmo")
|
||||||
|
|
|
@ -39,11 +39,13 @@
|
||||||
(cond ((null? in) (reverse out))
|
(cond ((null? in) (reverse out))
|
||||||
(else (lp (cdr in) (cons* (car in) infix out)))))))
|
(else (lp (cdr in) (cons* (car in) infix out)))))))
|
||||||
(define (make-navbar)
|
(define (make-navbar)
|
||||||
`(div (@ (id "navbar"))
|
(if (null? *navbar-links*)
|
||||||
,@(list-join
|
'()
|
||||||
(map (lambda (x) `(a (@ ,(href x "/")) ,x))
|
`((div (@ (id "navbar"))
|
||||||
'("about" "software" "writings" "photos"))
|
,@(list-join
|
||||||
" | ")))
|
(map (lambda (x) `(a (@ (href ,(cdr x))) ,(car x)))
|
||||||
|
*navbar-links*)
|
||||||
|
*navbar-infix*)))))
|
||||||
`(html
|
`(html
|
||||||
(head (title ,(rref request 'title *title*))
|
(head (title ,(rref request 'title *title*))
|
||||||
(meta (@ (name "Generator")
|
(meta (@ (name "Generator")
|
||||||
|
@ -51,15 +53,15 @@
|
||||||
(link (@ (rel "stylesheet")
|
(link (@ (rel "stylesheet")
|
||||||
(type "text/css")
|
(type "text/css")
|
||||||
(media "screen")
|
(media "screen")
|
||||||
(href "/base.css")))) ;fixme
|
(href ,*css-file*))))
|
||||||
(body
|
(body
|
||||||
(div (@ (id "rap"))
|
(div (@ (id "rap"))
|
||||||
(h1 (@ (id "header"))
|
(h1 (@ (id "header"))
|
||||||
(a (@ ,(href "")) ,*title*))
|
(a (@ ,(href "")) ,*title*))
|
||||||
,(make-navbar)
|
,@(make-navbar)
|
||||||
(div (@ (id "content"))
|
(div (@ (id "content"))
|
||||||
,@(rref request 'body '((p "(missing content?)"))))
|
,@(rref request 'body '((p "(missing content?)"))))
|
||||||
(div (@ (id "footer"))
|
(div (@ (id "footer"))
|
||||||
"powered by "
|
"powered by "
|
||||||
(a (@ (href "http://wingolog.org/software/tekuti/"))
|
(a (@ (href "http://wingolog.org/software/tekuti/"))
|
||||||
"parentheses"))))))
|
"tekuti"))))))
|
||||||
|
|
Loading…
Reference in a new issue