From 03c744e9f1b22f04461a2cab1224d157b3e88a98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Pant=C5=AF=C4=8Dek?= Date: Mon, 31 Mar 2025 22:30:28 +0200 Subject: [PATCH] Preliminary static assets serving. --- tools/schemify-tree.scm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tools/schemify-tree.scm b/tools/schemify-tree.scm index ee4e886..404fe25 100644 --- a/tools/schemify-tree.scm +++ b/tools/schemify-tree.scm @@ -23,10 +23,10 @@ ;; CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ;; (import (chicken process-context) - srfi-4 (chicken file) (chicken pathname) - (chicken format)) + (chicken format) + (chicken io)) (define (get-argv) (let* ((args (argv)) @@ -78,8 +78,11 @@ (if (null? tree) alst (let* ((fpath (car tree)) - (key (substring fpath dir-len)) - (value (with-input-from-file fpath read-u8vector))) + (key0 (substring fpath dir-len)) + (key (if (eq? (string-ref key0 0) #\/) + (substring key0 1) + key0)) + (value (with-input-from-file fpath read-string))) (loop (cdr tree) (cons (cons key value) alst)))))))