[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/02: website: Allow inclusion of Javascript.
From: |
Mathieu Lirzin |
Subject: |
01/02: website: Allow inclusion of Javascript. |
Date: |
Wed, 17 Jun 2015 20:13:44 +0000 |
mthl pushed a commit to branch master
in repository guix-artwork.
commit 199408ed97d99b9606a9f1ee18af1e166b0d1be1
Author: Mathieu Lirzin <address@hidden>
Date: Sun Jun 14 20:06:40 2015 +0200
website: Allow inclusion of Javascript.
* website/www/utils.scm (js-url): New procedure.
* website/www/shared.scm (html-page-header): Use it. Add #:js parameter.
---
website/www/shared.scm | 5 +++--
website/www/utils.scm | 4 ++++
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/website/www/shared.scm b/website/www/shared.scm
index 88dad4e..773fcc0 100644
--- a/website/www/shared.scm
+++ b/website/www/shared.scm
@@ -30,7 +30,7 @@
(define latest-guix-version
(make-parameter "0.8.2"))
-(define* (html-page-header title #:key (css "article.css"))
+(define* (html-page-header title #:key (css "article.css") js)
`(head (meta (@ (charset "utf-8")))
(meta (@ (name "author")
(content "GuixSD Contributors")))
@@ -58,7 +58,8 @@ Functional package management,")))
(rel "icon")
(href ,(image-url "favicon.png"))))
(link (@ (rel "license") (href "Pending...")))
- (title ,(string-append title " — GuixSD"))))
+ (title ,(string-append title " — GuixSD"))
+ ,(if js `(script (@ (src ,(js-url js))) "") "")))
(define (html-page-description)
`(div (@ (class "message-box msg-info"))
diff --git a/website/www/utils.scm b/website/www/utils.scm
index 96ccb5f..029951f 100644
--- a/website/www/utils.scm
+++ b/website/www/utils.scm
@@ -28,6 +28,7 @@
guix-url
static-base-url
css-url
+ js-url
image-url
thumb-url
screenshot-url
@@ -66,6 +67,9 @@
(define (css-url file)
(string-append (static-base-url) "css/" file))
+(define (js-url file)
+ (string-append (static-base-url) "js/" file))
+
(define (image-url file)
(string-append (static-base-url) "img/" file))