commit 6b8a916cd5220a30f716948da3d1c3e515872c43 Author: heyarne Date: Wed Jul 7 16:06:47 2021 +0200 Let there be light diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..2369787 --- /dev/null +++ b/.envrc @@ -0,0 +1,6 @@ +use flake + +export JANET_PATH="${PWD}/janet_modules" +mkdir -p $JANET_PATH + +PATH_add "${JANET_PATH}/bin" diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1ce9687 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +janet_modules/ +site/ diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..db5f9fd --- /dev/null +++ b/flake.lock @@ -0,0 +1,26 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1625191069, + "narHash": "sha256-M8/UH9pMgQEtuzY9bFwklYw8hx0pOKtUTyQC8E2UTHY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d8079260a3028ae3221d7a5467443ee3a9edd2b8", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..7a6b1ab --- /dev/null +++ b/flake.nix @@ -0,0 +1,13 @@ +{ + description = "A flake describing the build and dev environment for arnes.space"; + inputs.nixpkgs.url = github:NixOS/nixpkgs; + + outputs = { self, nixpkgs }: let + platform = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${platform}; + in { + devShell.${platform} = pkgs.mkShell { + buildInputs = [ pkgs.janet ]; + }; + }; +} diff --git a/index.janet b/index.janet new file mode 100644 index 0000000..3aa4858 --- /dev/null +++ b/index.janet @@ -0,0 +1,14 @@ +(import janet-html :as html) + +(defn as-html [h] + (html/encode (html/doctype :html5) h)) + +(bagatto/set-output-dir! "site") + +(def img-path-copier (bagatto/path-copier "static")) + +(def data {:dogs {:src (bagatto/* "images/*") + :attrs bagatto/parse-base}}) + +(def site {:index {:dest "index.html" + :out (fn [_] (as-html [:h1 "Hello World!"]))}}) diff --git a/project.janet b/project.janet new file mode 100644 index 0000000..ab2f9c8 --- /dev/null +++ b/project.janet @@ -0,0 +1,7 @@ +(declare-project + :name "arnes.space" + :description "a library that does things" # some example metadata. + + # Optional urls to git repositories that contain required artifacts. + :dependencies ["https://git.sr.ht/~subsetpark/bagatto" + "https://github.com/swlkr/janet-html"])