Safe Haskell | None |
---|
Various utilities used in the scaffolded site.
- addStaticContentExternal :: (ByteString -> Either a ByteString) -> (ByteString -> String) -> FilePath -> ([Text] -> Route master) -> Text -> Text -> ByteString -> GHandler sub master (Maybe (Either Text (Route master, [(Text, Text)])))
- globFile :: String -> String -> FilePath
- widgetFileNoReload :: FilePath -> Q Exp
- widgetFileReload :: FilePath -> Q Exp
- widgetFileJsCss :: (String, FilePath -> Q Exp) -> (String, FilePath -> Q Exp) -> FilePath -> Q Exp
Documentation
addStaticContentExternalSource
:: (ByteString -> Either a ByteString) | javascript minifier |
-> (ByteString -> String) | hash function to determine file name |
-> FilePath | location of static directory. files will be placed within a tmp subfolder |
-> ([Text] -> Route master) | route constructor, taking a list of pieces |
-> Text | filename extension |
-> Text | mime type |
-> ByteString | file contents |
-> GHandler sub master (Maybe (Either Text (Route master, [(Text, Text)]))) |
An implementation of addStaticContent
which stores the contents in an
external file. Files are created in the given static folder with names based
on a hash of their content. This allows expiration dates to be set far in
the future without worry of users receiving stale content.
globFile :: String -> String -> FilePathSource
expects a file extension for each type, e.g: hamlet lucius julius
widgetFileNoReload :: FilePath -> Q ExpSource
widgetFileReload :: FilePath -> Q ExpSource