1
0
Fork 0

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:
Tom Willemsen 2012-08-25 18:22:28 +02:00
parent a08ae0c9a7
commit 138c65c01b
3 changed files with 40 additions and 18 deletions

View file

@ -29,8 +29,8 @@
#:use-module ((sxml ssax) #:select (define-parsed-entity!))
#:export (*public-host* *public-port* *public-path-base*
*private-host* *private-port* *private-path-base*
*git-dir* *git* *debug* *admin-user* *admin-pass*
*css-file* *navbar-links* *navbar-infix*
*bootstrap-base* *git-dir* *git* *debug* *admin-user*
*admin-pass* *css-file* *navbar-links* *navbar-infix*
*title* *subtitle* *name*
*server-impl* *server-impl-args*))
@ -42,6 +42,7 @@
(define *private-port* 8080)
(define *private-path-base* '())
(define *bootstrap-base* "/bootstrap")
(define *git-dir* "~/blog.git")
(define *git* "git")
(define *css-file* "/base.css")

View file

@ -185,10 +185,13 @@
#:redirect (relurl '("admin")))))))
(define (page-index request body index)
(respond `(,(main-sidebar request index)
(respond `((div (@ (class "row"))
(div (@ (class "span9"))
,@(map (lambda (post)
(show-post post #f))
(latest-posts index #:limit 10)))
(div (@ (class "span3"))
,(main-sidebar request index))))
#:etag (assq-ref index 'master)))
(define (page-show-post request body index year month day post)

View file

@ -43,17 +43,33 @@
(cond ((null? in) (reverse out))
(else (lp (cdr in) (cons* (car in) infix out)))))))
(define (make-navbar)
(if (null? *navbar-links*)
`((div (@ (class "navbar navbar-inverse navbar-fixed-top"))
(div (@ (class "navbar-inner"))
(div (@ (class "container"))
(a (@ (class "btn btn-navbar")
(data-toggle "collapse")
(data-target ".nav-collapse"))
(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*)
'()
`((div (@ (id "navbar"))
,@(list-join
(map (lambda (x) `(a (@ (href ,(cdr x))) ,(car x)))
*navbar-links*)
*navbar-infix*)))))
(map (lambda (x)
`(li (a (@ (href ,(cdr x)))
,(car x))))
*navbar-links*)))))))))
`(html
(head (title ,title)
(meta (@ (name "Generator")
(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")
(type "text/css")
(media "screen")
@ -63,12 +79,14 @@
(title ,*title*)
(href ,(relurl `("feed" "atom"))))))
(body
(div (@ (id "rap"))
(h1 (@ (id "header"))
(a (@ ,(href "")) ,*title*))
,@(make-navbar)
(div (@ (class "container"))
(div (@ (id "content")) ,@body)
(div (@ (id "footer"))
"powered by "
(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"))))))