TristanCacqueray / haskell-xstatic

Low-Fat static file packaging for Haskell projects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

XStatic package for Haskell

Hackage Hackage Hackage Hackage Hackage License

Similar to xstatic-py, the goal of XStatic family of packages is to provide static file as Haskell library to be installed using cabal.

Usage

  • Create a XStaticFile using xstatic-th or file-embed.
  • Serve the files using xstatic (for wai) or servant-xstatic (for servant).
  • Add the files to your html page using lucid-xstatic or lucid2-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

Notes

  • 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.

Contribute

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

About

Low-Fat static file packaging for Haskell projects


Languages

Language:Haskell 93.1%Language:Nix 3.5%Language:HTML 3.3%Language:JavaScript 0.0%