set content-type for css when using a different template library
mooseyboots opened this issue · 3 comments
i was trying out ningle with spinneret, then thought to try caveman with spinneret also. i'm having trouble with handling static resources though.
if i take the caveman skeleton project, and change the main route to be:
(defroute "/" ()
(spinneret:with-html-string
(:doctype)
(:html
(:head
(:title "test")
(:link :type "image/png" :rel "icon" :href "/favicon.png")
(:link :type "text/css" :rel "stylesheet" :href "main.css")
(:body
(:h1 "my stuff")
the css doesn't load, and the browser console errors:
The resource from “http://localhost:5000/main.css” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).`
I'm unsure how to set the content-type in this case, as i'm trying to handle different types in the one route. is it not possible to write routes like this?
i tried out the cl-who
who library mentioned in the readme, and i have the same issue.
Is it working with the default Caveman, using Djula templates?
Did you write something more, a route definition?
set content-type for css
I don't think you'd write a route and set the content type, but you'd configure the web server (Clack) to serve static assets from a directory. That seems to be done by default somewhere.
(not a Caveman connoisseur, helping you brainstorm)
hi @vindarel thanks for chiming in. (and for all your CL resources! they're great, CL needs lots more docs for newcomers, and i say that as sb who knows lisp but not CL specifically.)
yes static assets work with the default set up. that's actually why i tried this out as i had trouble getting ningle to work with static assets and spinneret.
for now i have solved the issue using ningle, after lots of tears.
it would be good for more ningle/caveman/clack/lack to have more documentation. i all they have and after about 10 minutes of hacking i had already run into issues the docs don't mention at all.