mirror of
https://github.com/srid/ema.git
synced 2024-12-01 15:13:36 +03:00
Haskell static site generator that is change-aware
.github/workflows | ||
.vscode | ||
bin | ||
docs | ||
src | ||
.ghcid | ||
.gitignore | ||
CHANGELOG.md | ||
default.nix | ||
ema.cabal | ||
ema.svg | ||
flake.lock | ||
flake.nix | ||
hie.yaml | ||
LICENSE | ||
README.md | ||
shell.nix |
ema
Ema is a next-gen Haskell library for building jamstack-style static sites, with fast hot reload. See ema.srid.ca for documentation.
The simplest Ema app looks like this:
main :: IO ()
main = do
let name :: Text = "Ema"
runEmaPure $
encodeUtf8 $ "<b>Hello</b>, from " <> name
Quick Preview
If you have Nix installed with Flakes, give Ema a test-drive by running it to serve its own documentation:
PORT=8000 nix run github:srid/ema
NOTE: This will work if you have this repo's ./docs
directory locally. In future, ema should be made to include the docs in the nix derivation and reference it.
Hacking
Run bin/run
(or Ctrl+Shift+B in VSCode). This runs the clock example; modify ./.ghcid
to run a different example.
TODO
- MVP
- Implement hot reload, and ditch browser-sync
- server to client refresh
- client to server reconnect (on ghcid reload, or accidental client disconnect)
- or, investigate https://hackage.haskell.org/package/ghci-websockets
- Multi-websocket-client support
- Static site generation mode
- add common examples,
- filesystem watcher
- docs site for self (w/ breadcrumbs and possibly even search)
pre-announce,
- CLI UX
- opts
- logging
- How to serve non-generated files (css, img, etc.)
- Publish Data.LVar to Hackage
- documentation (guide)
- Avoid tailwind CDN in docs (use twind or windicss) for better lighthouse score
doc notes,
- hot reload fast, morphdom
- html templates + tailwind for fast style feedback
- use async:race to avoid ghcid ghosts
- tailwind + blaze-html layout (BlazeWind?) for no-frills getting started
- dealing with errors
- messaging re: hakyll
- safer/ simpler routes system
- bring your own templates / DSL
- messaging re: svelte
- SSE