diff options
-rw-r--r-- | guix-web/view/html.scm | 26 |
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) |