1 {-# LANGUAGE TemplateHaskell #-}
2 module Settings.StaticFiles where
4 import Settings (appStaticDir, compileTimeAppSettings)
5 import Yesod.Static (staticFiles)
7 -- This generates easy references to files in the static directory at compile time,
8 -- giving you compile-time verification that referenced files exist.
9 -- Warning: any files added to your static directory during run-time can't be
10 -- accessed this way. You'll have to use their FilePath or URL to access them.
12 -- For example, to refer to @static/js/script.js@ via an identifier, you'd use:
16 -- If the identifier is not available, you may use:
18 -- StaticFile ["js", "script.js"] []
19 staticFiles (appStaticDir compileTimeAppSettings)