Basic bootstrap layout
* tekuti/config.scm (*bootstrap-base*): New setting. This variable should be a relative or absolute URL to the location of the bootstrap base, where the `css', `img' and `js' directories containing the correct files. * tekuti/page.scm (page-index): Place the `main-sidebar' in a column next to the main text instead of above it. * tekuti/template.scm (templatize): Make the template more bootstrappy.
This commit is contained in:
parent
a08ae0c9a7
commit
138c65c01b
3 changed files with 40 additions and 18 deletions
|
@ -29,8 +29,8 @@
|
||||||
#:use-module ((sxml ssax) #:select (define-parsed-entity!))
|
#:use-module ((sxml ssax) #:select (define-parsed-entity!))
|
||||||
#:export (*public-host* *public-port* *public-path-base*
|
#:export (*public-host* *public-port* *public-path-base*
|
||||||
*private-host* *private-port* *private-path-base*
|
*private-host* *private-port* *private-path-base*
|
||||||
*git-dir* *git* *debug* *admin-user* *admin-pass*
|
*bootstrap-base* *git-dir* *git* *debug* *admin-user*
|
||||||
*css-file* *navbar-links* *navbar-infix*
|
*admin-pass* *css-file* *navbar-links* *navbar-infix*
|
||||||
*title* *subtitle* *name*
|
*title* *subtitle* *name*
|
||||||
*server-impl* *server-impl-args*))
|
*server-impl* *server-impl-args*))
|
||||||
|
|
||||||
|
@ -42,6 +42,7 @@
|
||||||
(define *private-port* 8080)
|
(define *private-port* 8080)
|
||||||
(define *private-path-base* '())
|
(define *private-path-base* '())
|
||||||
|
|
||||||
|
(define *bootstrap-base* "/bootstrap")
|
||||||
(define *git-dir* "~/blog.git")
|
(define *git-dir* "~/blog.git")
|
||||||
(define *git* "git")
|
(define *git* "git")
|
||||||
(define *css-file* "/base.css")
|
(define *css-file* "/base.css")
|
||||||
|
|
|
@ -185,10 +185,13 @@
|
||||||
#:redirect (relurl '("admin")))))))
|
#:redirect (relurl '("admin")))))))
|
||||||
|
|
||||||
(define (page-index request body index)
|
(define (page-index request body index)
|
||||||
(respond `(,(main-sidebar request index)
|
(respond `((div (@ (class "row"))
|
||||||
,@(map (lambda (post)
|
(div (@ (class "span9"))
|
||||||
(show-post post #f))
|
,@(map (lambda (post)
|
||||||
(latest-posts index #:limit 10)))
|
(show-post post #f))
|
||||||
|
(latest-posts index #:limit 10)))
|
||||||
|
(div (@ (class "span3"))
|
||||||
|
,(main-sidebar request index))))
|
||||||
#:etag (assq-ref index 'master)))
|
#:etag (assq-ref index 'master)))
|
||||||
|
|
||||||
(define (page-show-post request body index year month day post)
|
(define (page-show-post request body index year month day post)
|
||||||
|
|
|
@ -43,17 +43,33 @@
|
||||||
(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)
|
||||||
(if (null? *navbar-links*)
|
`((div (@ (class "navbar navbar-inverse navbar-fixed-top"))
|
||||||
'()
|
(div (@ (class "navbar-inner"))
|
||||||
`((div (@ (id "navbar"))
|
(div (@ (class "container"))
|
||||||
,@(list-join
|
(a (@ (class "btn btn-navbar")
|
||||||
(map (lambda (x) `(a (@ (href ,(cdr x))) ,(car x)))
|
(data-toggle "collapse")
|
||||||
*navbar-links*)
|
(data-target ".nav-collapse"))
|
||||||
*navbar-infix*)))))
|
(span (@ (class "icon-bar")) "")
|
||||||
|
(span (@ (class "icon-bar")) "")
|
||||||
|
(span (@ (class "icon-bar")) ""))
|
||||||
|
(a (@ (class "brand")
|
||||||
|
(href "/"))
|
||||||
|
,*title*)
|
||||||
|
(div (@ (class "nav-collapse collapse"))
|
||||||
|
(ul (@ (class "nav"))
|
||||||
|
,(if (null? *navbar-links*)
|
||||||
|
'()
|
||||||
|
(map (lambda (x)
|
||||||
|
`(li (a (@ (href ,(cdr x)))
|
||||||
|
,(car x))))
|
||||||
|
*navbar-links*)))))))))
|
||||||
`(html
|
`(html
|
||||||
(head (title ,title)
|
(head (title ,title)
|
||||||
(meta (@ (name "Generator")
|
(meta (@ (name "Generator")
|
||||||
(content "An unholy concoction of parenthetical guile")))
|
(content "An unholy concoction of parenthetical guile")))
|
||||||
|
(link (@ (rel "stylesheet")
|
||||||
|
(href ,*bootstrap-base* "/css/bootstrap.min.css")))
|
||||||
|
(style "body { padding-top: 60px; }")
|
||||||
(link (@ (rel "stylesheet")
|
(link (@ (rel "stylesheet")
|
||||||
(type "text/css")
|
(type "text/css")
|
||||||
(media "screen")
|
(media "screen")
|
||||||
|
@ -63,12 +79,14 @@
|
||||||
(title ,*title*)
|
(title ,*title*)
|
||||||
(href ,(relurl `("feed" "atom"))))))
|
(href ,(relurl `("feed" "atom"))))))
|
||||||
(body
|
(body
|
||||||
(div (@ (id "rap"))
|
,@(make-navbar)
|
||||||
(h1 (@ (id "header"))
|
(div (@ (class "container"))
|
||||||
(a (@ ,(href "")) ,*title*))
|
|
||||||
,@(make-navbar)
|
|
||||||
(div (@ (id "content")) ,@body)
|
(div (@ (id "content")) ,@body)
|
||||||
(div (@ (id "footer"))
|
(div (@ (id "footer"))
|
||||||
"powered by "
|
"powered by "
|
||||||
(a (@ (href "http://wingolog.org/software/tekuti/"))
|
(a (@ (href "http://wingolog.org/software/tekuti/"))
|
||||||
"tekuti"))))))
|
"tekuti")
|
||||||
|
", "
|
||||||
|
(a (@ (href "http://twitter.github.com/bootstrap/"))
|
||||||
|
"bootstrap")))
|
||||||
|
(script (@ (src ,*bootstrap-base* "/js/bootstrap.min.js"))))))
|
||||||
|
|
Loading…
Reference in a new issue