xstatic-th-0.1.0: Automatic generation of XStaticFile
Safe HaskellSafe-Inferred
LanguageHaskell2010

XStatic.TH

Description

Create a XStaticFile served as /my-file.txt or /xstatic/my-file.txt:

myFile :: XStaticFile
myFile = $(embedXStaticFile "./data/my-file.txt")
Synopsis

Documentation

embedXStaticFile :: FilePath -> Q Exp Source #

Embed a static file in its compressed form.

The following rules are applied to convert a local filepath to the expected request path:

  • ., / and "data/" prefix are removed
  • ".gz" and "index.html" suffix are removed

embedXStaticFileVersion :: FilePath -> Version -> Q Exp Source #

Same as embedXStaticFile, but using the provided Version for the xfETag value.

re-export from XStatic

data XStaticFile #

A static file definition.

Use the xstatic-th or file-embed library to embed a local file.