From bdd063a17d79ab2df1f3ad5772f47f75d2328911 Mon Sep 17 00:00:00 2001 From: heyarne Date: Thu, 15 Jul 2021 22:00:21 +0200 Subject: [PATCH] Add README with build instructions --- README.md | 28 ++++++++++++++++++++++++++++ flake.nix | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..68729f7 --- /dev/null +++ b/README.md @@ -0,0 +1,28 @@ +# 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 +``` + +There is some code that starts a networked repl when you add the `--repl` flag to the above command. This allows you to interactively evaluate parts of the website, which is very handy if you want to understand how it works or change some parts. + +The build output is in `site`, you can upload that to wherever static files are served from. + +### Continuously rebuild the site on changes + +Easy as π! Use `entr`, which is included in the development environment: + +``` fish +while true; fd | entr -d sh -c 'bag index.janet'; end +``` diff --git a/flake.nix b/flake.nix index d3792a9..b3d70c7 100644 --- a/flake.nix +++ b/flake.nix @@ -7,7 +7,7 @@ pkgs = nixpkgs.legacyPackages.${platform}; in { devShell.${platform} = pkgs.mkShell { - buildInputs = with pkgs; [ janet multimarkdown ]; + buildInputs = with pkgs; [ janet multimarkdown entr ]; }; }; }