1
1
mirror of https://github.com/srid/rib.git synced 2024-10-26 13:53:36 +03:00
Haskell static site generator based on Shake (superseded by Ema)
Go to file
2019-07-02 09:27:37 -04:00
example Isolate library and executable (#11) 2019-07-01 18:14:01 -04:00
src Reuse renderInline for elPandocInlines 2019-07-01 20:21:56 -04:00
.gitignore Flesh out example in README 2019-07-02 09:27:37 -04:00
default.nix Change project name (#10) 2019-06-30 18:06:16 -04:00
README.md Flesh out example in README 2019-07-02 09:27:37 -04:00
rib.cabal Isolate library and executable (#11) 2019-07-01 18:14:01 -04:00

rib

Rib is a static site generator written in Haskell using sensible technologies like Shake, Reflex and Clay. It is still a work in progress but will soon be ready for general use.

Example

See ./example (author's actual website in fact) to see how the Rib library can be used to write your own static site generator in a few lines of code which includes the HTML and CSS of the site:

$ cloc --by-file example/*.hs
[...]
-------------------------------------------------------------------------------
File                             blank        comment           code
-------------------------------------------------------------------------------
example/HTML.hs                     14              7             63
example/CSS.hs                       9              1             32
example/Main.hs                      8              7             16
-------------------------------------------------------------------------------
SUM:                                31             15            111
-------------------------------------------------------------------------------

With Rib you do not have to deal with the less powerful template engines or write raw HTML/CSS by hand. Do everything in Haskell, and concisely at that!

Local server when editing only content

nix-build -A ghc.rib
cd example
../result/bin/rib-example serve --watch

... when hacking on Haskell sources

nix-shell -A shells.ghc --run "ghcid -c 'cabal new-repl rib-example' -T 'System.Directory.withCurrentDirectory \"example\" \$ Main.dev'"

TODO

  • Use my own jsonCache' and drop dependency on Slick

Article Ideas

  • Github CI for OSS haskell projects
  • Lens and friends
  • mtl
  • string types
  • personal nix cache