summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEkaitz Zarraga <ekaitz@elenq.tech>2023-10-04 16:45:01 +0200
committerEkaitz Zarraga <ekaitz@elenq.tech>2023-10-04 16:45:01 +0200
commit443582b2667e86ecac47de7bb77cbcc5bb354256 (patch)
treec9a1e6ab789d2166d22465fbd8bd93cfa34ed756 /src
parentf1485bf9b53b30f609bf83b2fbd7bb577c204e59 (diff)
html: js and css work as media and as raw strings
Diffstat (limited to 'src')
-rw-r--r--src/html.scm16
1 files changed, 8 insertions, 8 deletions
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