2019-07-01 01:06:16 +03:00
|
|
|
# rib
|
2019-06-18 02:02:02 +03:00
|
|
|
|
2019-07-01 01:06:16 +03:00
|
|
|
<!--
|
|
|
|
Credit for this image: https://www.svgrepo.com/svg/24439/ribs
|
|
|
|
-->
|
2019-07-05 17:12:27 +03:00
|
|
|
<img src="https://raw.githubusercontent.com/srid/rib/master/example/content/static/ribs.svg?sanitize=true" width="150" />
|
2019-07-01 01:06:16 +03:00
|
|
|
|
|
|
|
Rib is a static site generator written in Haskell using sensible technologies
|
2019-07-11 17:18:14 +03:00
|
|
|
like `Shake`, `Lucid` and `Clay`. It is still a work in progress but will soon
|
2019-07-02 16:27:37 +03:00
|
|
|
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:
|
|
|
|
|
|
|
|
```
|
2019-07-12 23:40:24 +03:00
|
|
|
$ cloc --by-file example/Main.hs
|
2019-07-02 16:27:37 +03:00
|
|
|
[...]
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
File blank comment code
|
|
|
|
-------------------------------------------------------------------------------
|
2019-07-12 23:55:40 +03:00
|
|
|
example/Main.hs 15 6 92
|
2019-07-02 16:27:37 +03:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
```
|
|
|
|
|
|
|
|
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!
|
2019-06-18 02:02:02 +03:00
|
|
|
|
2019-06-30 23:36:17 +03:00
|
|
|
## Local server when editing only content
|
2019-06-29 01:06:37 +03:00
|
|
|
|
|
|
|
```bash
|
2019-07-11 20:58:46 +03:00
|
|
|
nix-build
|
2019-07-02 16:27:37 +03:00
|
|
|
cd example
|
|
|
|
../result/bin/rib-example serve --watch
|
2019-06-29 01:06:37 +03:00
|
|
|
```
|
|
|
|
|
2019-07-11 20:58:46 +03:00
|
|
|
Or simply (no cabal file needed),
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
2019-07-12 23:25:14 +03:00
|
|
|
nix-shell ../default.nix --run "ghcid -c 'ghci -Wall -i../src Main.hs' -T 'Rib.App.dev Main.settings' --reload=Main.hs"
|
2019-07-11 20:58:46 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-06-30 23:36:17 +03:00
|
|
|
## ... when hacking on Haskell sources
|
2019-06-29 01:06:37 +03:00
|
|
|
|
|
|
|
```bash
|
2019-07-11 20:58:46 +03:00
|
|
|
nix-shell --run "ghcid -c 'cabal new-repl rib-example' -T
|
2019-07-05 17:12:27 +03:00
|
|
|
'System.Directory.withCurrentDirectory \"example\" \$ Rib.App.dev Main.settings'"
|
2019-06-29 01:06:37 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
### Article Ideas
|
2019-06-19 04:43:13 +03:00
|
|
|
|
|
|
|
- Github CI for OSS haskell projects
|
2019-06-22 17:34:03 +03:00
|
|
|
- Lens and friends
|
|
|
|
- mtl
|
|
|
|
- string types
|
|
|
|
- personal nix cache
|