diff options
author | Pjotr Prins | 2023-08-28 12:17:07 +0200 |
---|---|---|
committer | Pjotr Prins | 2023-08-28 12:17:07 +0200 |
commit | 89801fbdb731ab64d49dd92fe5ad3ac2ee647e4d (patch) | |
tree | 8b79f41fdc3fa7acbd79f2859b21458d1ed3b18e /web | |
parent | 2b11169a6757481dd33169bed1579620caad6fc5 (diff) | |
download | gn-guile-89801fbdb731ab64d49dd92fe5ad3ac2ee647e4d.tar.gz |
Serve image
Diffstat (limited to 'web')
-rw-r--r-- | web/view/brand/msk.scm | 5 | ||||
-rw-r--r-- | web/view/view.scm | 5 | ||||
-rwxr-xr-x | web/webserver.scm | 26 |
3 files changed, 17 insertions, 19 deletions
diff --git a/web/view/brand/msk.scm b/web/view/brand/msk.scm index 9215c20..99cb283 100644 --- a/web/view/brand/msk.scm +++ b/web/view/brand/msk.scm @@ -28,13 +28,16 @@ (meta (@ (name "author") (content "GN4MSK team (https://msk.genenetwork.org/)"))) (meta (@ (name "viewport") (content "width=device-width, initial-scale=1"))) + ; (meta (@ (http-equiv "refresh") (content "5"))) (link (@ (rel "stylesheet") (media "screen") (type "text/css") (href "./css/gn-doc.css"))) ,@head) - (body (h1 ,title) + (body + (img (@ (src "/static/images/GN4MSK.png"))) + (h1 ,title) (p ,info) (footer (p "Copyright © 2005—2023 by the GeneNetwork community with a touch of " (span (@ (class "lambda")) "λ") "!") diff --git a/web/view/view.scm b/web/view/view.scm index e3b4ee1..6a0b8ba 100644 --- a/web/view/view.scm +++ b/web/view/view.scm @@ -13,6 +13,7 @@ (define* (view-brand path) (msk-html #:info - '((h2 "HI") - (img (@ (src "static/images/CMOR.jpg")) + '((h2 "Introduction") + (p "New project for MSK with some live coding!") + (img (@ (src "/static/images/CMOR.jpg") )))) diff --git a/web/webserver.scm b/web/webserver.scm index 91ff6d6..d697735 100755 --- a/web/webserver.scm +++ b/web/webserver.scm @@ -18,6 +18,7 @@ ;; (ice-9 source) (srfi srfi-1) (srfi srfi-11) ; let-values + (srfi srfi-19) ; time (srfi srfi-26) (rnrs io ports) ; bytevector-all (web http) @@ -88,22 +89,15 @@ otherwise search for set/group data" (define (file-extension file-name) (last (string-split file-name #\.))) -(define* (render-static-image path #:key (extra-headers '())) - (list `((content-type - . ,(assoc-ref file-mime-types - (file-extension "CMOR.jpg"))) ; (last-modified . ,(time-utc->date modified)) - ) - (call-with-input-file "./static/images/CMOR.jpg" get-bytevector-all))) - -#! -(call-with-input-file "./static/images/CMOR.jpg" get-bytevector-all) -(list (append extra-headers - '((content-type . (application/octet-stream))) - (lambda (port) - (put-bytevector port - (call-with-input-file "./static/images/CMOR.jpg" get-bytevector-all) - ) -!# +(define* (render-static-image file-name #:key (extra-headers '())) + (let* ((stat (stat file-name #f)) + (modified (and stat + (make-time time-utc 0 (stat:mtime stat))))) + (list `((content-type . ,(assoc-ref file-mime-types + (file-extension file-name))) + (last-modified . ,(time-utc->date modified))) + + (call-with-input-file "./static/images/CMOR.jpg" get-bytevector-all)))) (define* (render-doc path page #:optional rec #:key (extra-headers '())) (list (append extra-headers |