문제

I was wondering if someone could tell me how I get a TypeSafe URL to a static resource. I've got "/static" as a subsite serving files, but I'm unclear on how to refer to specific files from there using typesafe URLs. The idea is that I could include them in things like addScript and such.

I am very new to Yesod, but I couldn't find an example like this in either the Yesod book or in the FPComplete tutorials.

도움이 되었습니까?

해결책

Something like this: src=@{StaticR img_myimage_png}

Yesod looks inside the static directory and the file name will contain the directory name separated by _. Replace . with _ too.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top