문제

I'm wondering what the best way to go about including css in Happstack webpages would be. I tried google, with no luck, so I thought I would ask here.

도움이 되었습니까?

해결책

The easiest method for me was to serve them from a static folder. Eg adding a handler like:

dir "static" $ serveDirectory DisableBrowsing [] "www"

Replace "www" with the directory that you want happstack to use. For more information on serveDirectory, see the Haddock documentation.

Then I have a www/css folder where all of my css lives. I use Blaze templates so I link to them all directly:

H.link ! A.rel "stylesheet" ! A.type_ "text/css" ! A.href "/static/css/foo.css"
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top