summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2015-01-30 08:29:26 -0500
committerDavid Thompson <dthompson2@worcester.edu>2015-01-30 08:29:26 -0500
commit1a190832c44700a89fb1d55d2de1ca423089ae76 (patch)
tree6a435358056230eebda2ce8295432989d7915dd2
parent1e8e1a009ba4d946ef86c656a2d7582af8216db0 (diff)
view: html: Add render-stylesheet procedure.
* guix-web/view/html.scm (render-stylesheet): New procedure. (main-layout): Use it. (stylesheets): New variable.
-rw-r--r--guix-web/view/html.scm26
1 files changed, 16 insertions, 10 deletions
diff --git a/guix-web/view/html.scm b/guix-web/view/html.scm
index 4331692..7016ba8 100644
--- a/guix-web/view/html.scm
+++ b/guix-web/view/html.scm
@@ -58,22 +58,28 @@
(javascript "/js/routes.js" agpl3+)))
(define (script-tag javascript)
+(define stylesheets
+ (list "/css/bootstrap.css"
+ "/css/guix.css"))
+
`(script (@ (type "text/javascript")
(src ,(javascript-source-uri javascript)))
;; hack to ensure closing </script> tag
""))
+(define (render-stylesheet stylesheet-uri)
+ `(link (@ (rel "stylesheet")
+ (href ,stylesheet-uri))))
+
(define (main-layout subtitle body)
- `(html
- (head
- (meta (@ (content "text/html;charset=utf-8")
- (http-equiv "Content-Type")))
- (title ,(string-append "GNU Guix - " subtitle))
- (link (@ (rel "stylesheet")
- (href "/css/bootstrap.css")))
- (link (@ (rel "stylesheet")
- (href "/css/guix.css"))))
- (body ,body)))
+ `((doctype "HTML")
+ (html
+ (head
+ (meta (@ (content "text/html;charset=utf-8")
+ (http-equiv "Content-Type")))
+ (title ,(string-append "GNU Guix - " subtitle))
+ ,@(map render-stylesheet stylesheets))
+ (body ,body))))
(define (render-package-license package)
(define (license-link license)