1
1
mirror of https://github.com/srid/rib.git synced 2024-11-26 13:50:31 +03:00
Haskell static site generator based on Shake (superseded by Ema)
Go to file
Sridhar Ratnakumar da41b7dee6 Use Read instead of FromJSON in Yaml metadata
Read values are human-friendly
2019-07-12 16:32:47 -04:00
example Use Read instead of FromJSON in Yaml metadata 2019-07-12 16:32:47 -04:00
src/Rib Use Read instead of FromJSON in Yaml metadata 2019-07-12 16:32:47 -04:00
.gitignore Flesh out example in README 2019-07-02 09:27:37 -04:00
default.nix Drop reflex-platform 2019-07-11 13:58:46 -04:00
README.md Move specialized code and types to Rib.Simple (#18) 2019-07-12 16:25:14 -04:00
rib.cabal Use Read instead of FromJSON in Yaml metadata 2019-07-12 16:32:47 -04:00

rib

Rib is a static site generator written in Haskell using sensible technologies like Shake, Lucid 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/Main.hs                     19              9            100
-------------------------------------------------------------------------------

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
cd example
../result/bin/rib-example serve --watch

Or simply (no cabal file needed),


nix-shell ../default.nix --run "ghcid -c 'ghci -Wall -i../src Main.hs' -T 'Rib.App.dev Main.settings' --reload=Main.hs"

... when hacking on Haskell sources

nix-shell --run "ghcid -c 'cabal new-repl rib-example' -T
'System.Directory.withCurrentDirectory \"example\" \$ Rib.App.dev Main.settings'"

Article Ideas

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