clojureclojurescriptboot-cljhoplon

Boot and Hoplon not loading the CSS file and the images in the 'resources' folder


I have been using the Boot build tool with Hoplon and a Castra backend for a bit but recently have come across a glitch that I don't quite seem to understand. It happens across all my Hoplon projects often. The problem seems to be that when I go to localhost:8000 in the browser sometimes it displays the CSS that is written in 'app.css' correctly and sometimes it doesn't. On top of that sometimes it displays the background images and sometimes it doesn't. I mean in the browser.

I have tried debugging the error for a very long time and have found some ways of getting both loading but not consistently. Sometimes if I edit the hLisp page and save it loads the CSS and Background Images but sometimes that doesn't work. Another way is to edit the app.css file and save. Both are somewhat unreliable.

Any help would be greatly appreciated.

Cheers


Solution

  • I figured out what was causing the error.

    (link :href "app.css" ...
    

    Should be replaced by

    (link :href "public/app.css" ...
    

    Cheers