From 443582b2667e86ecac47de7bb77cbcc5bb354256 Mon Sep 17 00:00:00 2001 From: Ekaitz Zarraga Date: Wed, 4 Oct 2023 16:45:01 +0200 Subject: html: js and css work as media and as raw strings --- src/html.scm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/html.scm') diff --git a/src/html.scm b/src/html.scm index 107b78c..7c0485f 100644 --- a/src/html.scm +++ b/src/html.scm @@ -109,9 +109,6 @@ uri path)) -(define css media) -(define js media) - (define* (person name #:key (email "") (uri "") #:allow-other-keys) @@ -136,12 +133,15 @@ ,(post-content-html post)))) (define (render-style style) - ;; TODO it escapes the contents!! if added inline :( - `(link (@(rel stylesheet) - (href ,(media-uri style))))) + (if (media? style) + `(link (@(rel stylesheet) + (href ,(media-uri style)))) + `(style ,(lambda () (display style))))) + (define (render-script script) - ;; TODO it escapes the contents!! if added inline :( - `(script (@(src ,(media-uri script))))) + (if (media? script) + `(script (@(src ,(media-uri script)))) + `(script ,(lambda () (display script))))) (define (render-index index) `(html -- cgit v1.2.3