Similar to xstatic-py, the goal of XStatic family of packages is to provide static file as Haskell library to be installed using cabal.
- Create a XStaticFile using
xstatic-th
orfile-embed
. - Serve the files using
xstatic
(for wai) orservant-xstatic
(for servant). - Add the files to your html page using
lucid-xstatic
orlucid2-xstatic
.
Checkout the demo, demo-xterm or websockets-ki-htmx for examples.
- Use this collection by adding this configuration to your
cabal.project
:
source-repository-package
type: git
location: https://github.com/TristanCacqueray/haskell-xstatic
tag: 205506d8b53af9f9e448bfd0e2eadec349058eca
subdir: xstatic-htmx xstatic-tailwind
- The files are embedded in the code.
- Compressed files are served as-is by automatically adding the
Content-Encoding: gzip
headers. - When adding new packages, keep the original files license. XStatic only adds metadata.
Contributions and bug reports are welcome! To work on this project you need a Haskell toolchain: get-started.
Validate your change with:
$ cabal build -O0 all --ghc-option=-Werror && cabal test -O0 all