1
1
mirror of https://github.com/srid/rib.git synced 2024-12-02 00:44:08 +03:00

Flesh out example in README

This commit is contained in:
Sridhar Ratnakumar 2019-07-02 09:27:37 -04:00
parent 65913cb012
commit a836a292ea
2 changed files with 29 additions and 6 deletions

4
.gitignore vendored
View File

@ -1,5 +1,5 @@
dist-newstyle
dist
result
.shake
content.generated
example/.shake
example/content.generated

View File

@ -6,15 +6,38 @@ Credit for this image: https://www.svgrepo.com/svg/24439/ribs
<img src="https://raw.githubusercontent.com/srid/rib/master/example/content/images/ribs.svg?sanitize=true" width="150" />
Rib is a static site generator written in Haskell using sensible technologies
like `Shake` and `Reflex`. See `./example` to see how the library can be used;
it contains the author's actual website. It is still a work in progress but will
soon be ready for general use.
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
```bash
nix-build -A ghc.rib
./result/bin/rib serve --watch
cd example
../result/bin/rib-example serve --watch
```
## ... when hacking on Haskell sources