1
1
mirror of https://github.com/srid/rib.git synced 2024-12-03 07:25:50 +03:00
rib/README.md

64 lines
2.1 KiB
Markdown
Raw Normal View History

2019-07-01 01:06:16 +03:00
# rib
2019-07-01 01:06:16 +03:00
<!--
Credit for this image: https://www.svgrepo.com/svg/24439/ribs
-->
2019-07-02 01:19:00 +03:00
<img src="https://raw.githubusercontent.com/srid/rib/master/example/content/images/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-02 16:27:37 +03:00
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
-------------------------------------------------------------------------------
2019-07-03 16:39:47 +03:00
example/Main.hs 23 16 102
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!
## Local server when editing only content
```bash
2019-07-01 01:06:16 +03:00
nix-build -A ghc.rib
2019-07-02 16:27:37 +03:00
cd example
../result/bin/rib-example serve --watch
```
## ... when hacking on Haskell sources
```bash
nix-shell -A shells.ghc --run "ghcid -c 'cabal new-repl rib-example' -T 'System.Directory.withCurrentDirectory \"example\" \$ Main.dev'"
```
## TODO
2019-07-03 16:39:47 +03:00
- [ ] Use my own jsonCache' and drop dependency on Slick
- [ ] Combine multiple files into one `Site.hs`
- [ ] Hakyll-like programming interface:
- Shake buildActions extension in Settings, with default implementation
`buildActions :: Settings x -> Action ()`
Make staticFilePatterns and postFilePatterns part of the default impl.
- [ ] One file dev?
- User creates Site.hs, then content/Hello.md and that's it.
- A shebang in Site.hs will allow them to build it straight!
### Article Ideas
- Github CI for OSS haskell projects
- Lens and friends
- mtl
- string types
- personal nix cache