arnes.space-bagatto/README.md

37 lines
1.4 KiB
Markdown

# arnes.space
The files in this repository contain the basis for https://arnes.space. The development environment is defined using the [nix package manager](https://nixos.org/). After you have installed it and enabled [nix flakes](https://nixos.wiki/wiki/Flakes) you can install all dependencies required to build the static page using the following commands:
``` bash
nix develop
jpm load-lockfile
```
## Architecture
The site itself is built using [bagatto](https://bagatto.co/), which is a static site generator using [the janet programming language](https://janet-lang.org/). The main entry point is `index.janet` and you can rebuild the website using the bagatto binary:
```
bag index.janet
```
The build output is in `site`, you can upload that to wherever static files are served from.
### Starting a `netrepl` from within bagatto
When running bagatto with the `--repl` flag, you can start a `netrepl` which [Conjure](https://github.com/Olical/conjure) can connect to:
``` lisp
(def env (curenv))
(def t (thread/new (fn [_] (netrepl/server "127.0.0.1" 9365 env))))
```
All the bagatto functions like `eval-data` and `eval-site` are available in the netrepl session as well. A static site generator from your repl! 🔥
### Continuously rebuild the site on changes
Easy as π! Use `entr`, which is included in the development environment:
``` fish
while sleep 0.5s; fd | entr -d sh -c 'bag index.janet'; end
```