1
1
mirror of https://github.com/srid/ema.git synced 2024-11-25 20:12:20 +03:00
Haskell static site generator that is change-aware
Go to file
Sridhar Ratnakumar bb9c95a4b9
Add logging support (#17)
* Prototype logging using monad-logger-extras

* Use logging in Server.hs

* Add logging to generate

* Cleanup websocket logging

* Cleanups
2021-04-26 12:46:35 -04:00
.github/workflows Implement static assert serving/generating 2021-04-25 13:15:30 -04:00
.vscode Add script to run via tmux 2021-04-21 20:43:03 -04:00
bin Smooth route click (#9) 2021-04-22 10:34:01 -04:00
docs Add logging support (#17) 2021-04-26 12:46:35 -04:00
src Add logging support (#17) 2021-04-26 12:46:35 -04:00
.ghcid Add staticAssets for paths to static assets; add -C to change CWD 2021-04-25 12:40:50 -04:00
.gitignore Publish docs to GitHub Pages (#15) 2021-04-24 12:04:16 -04:00
CHANGELOG.md initial commit of WIP code 2021-04-19 11:07:52 -04:00
default.nix Add default.nix for legacy nix 2021-04-20 18:00:55 -04:00
ema.cabal Add logging support (#17) 2021-04-26 12:46:35 -04:00
flake.lock Add Diary example using org-mode and fsnotify (#2) 2021-04-20 15:04:48 -04:00
flake.nix Add logging support (#17) 2021-04-26 12:46:35 -04:00
hie.yaml Publish docs to GitHub Pages (#15) 2021-04-24 12:04:16 -04:00
LICENSE initial commit of WIP code 2021-04-19 11:07:52 -04:00
README.md Add logging support (#17) 2021-04-26 12:46:35 -04:00
shell.nix initial commit of WIP code 2021-04-19 11:07:52 -04:00

ema

Ema is a next-gen Haskell library for building jamstack-style static sites, with fast hot reload. See ema.srid.ca for further information.

The simplest Ema app looks like this:

main :: IO ()
main = do
  let name :: Text = "Ema"
  runEmaPure $ \_ ->
    encodeUtf8 $ "<b>Hello</b>, from " <> name

Hacking

Run bin/run (or Ctrl+Shift+B in VSCode). This runs the documentation example; modify ./.ghcid to run a different example, such as the clock example - which updates every second, demonstrating hot reload.

TODO

  • MVP
  • Implement hot reload, and ditch browser-sync
  • 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
      • Expose it to apps (inc/ helpers) in a simple way
  • deal with errors
  • 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