27 lines
743 B
Haskell
27 lines
743 B
Haskell
module Settings.StaticFiles
|
|
( module Settings.StaticFiles
|
|
, module Yesod.EmbeddedStatic
|
|
) where
|
|
|
|
import ClassyPrelude
|
|
|
|
import Settings (appStaticDir, compileTimeAppSettings)
|
|
import Yesod.EmbeddedStatic
|
|
|
|
-- This generates easy references to files in the static directory at compile time,
|
|
-- giving you compile-time verification that referenced files exist.
|
|
-- Warning: any files added to your static directory during run-time can't be
|
|
-- accessed this way.
|
|
--
|
|
-- For example, to refer to @static/js/script.js@ via an identifier, you'd use:
|
|
--
|
|
-- js_script_js
|
|
|
|
#ifdef DEVELOPMENT
|
|
#define DEV_BOOL True
|
|
#else
|
|
#define DEV_BOOL False
|
|
#endif
|
|
|
|
mkEmbeddedStatic DEV_BOOL "embeddedStatic" [embedDir $ appStaticDir compileTimeAppSettings]
|