diff --git a/.gitignore b/.gitignore index d421232..d0e8eac 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,6 @@ out node_modules certs + +# Local Netlify folder +.netlify diff --git a/.tangled/pipelines/netlify.yml b/.tangled/pipelines/netlify.yml new file mode 100644 index 0000000..728992c --- /dev/null +++ b/.tangled/pipelines/netlify.yml @@ -0,0 +1,18 @@ +# +when: + - event: ["push", "manual"] + branch: ["main"] + +engine: "nixery" + +dependencies: + nixpkgs: + - deno + - rsync + - netlify-cli + +steps: + - name: "Build output" + command: "deno task build-prod" + - name: "Push to Netlify" + command: "netlify deploy --prod --site=domlink --dir=out" diff --git a/flake.nix b/flake.nix index 6c90755..3d7a9f5 100644 --- a/flake.nix +++ b/flake.nix @@ -11,7 +11,7 @@ in { devShell = pkgs.mkShell { buildInputs = with pkgs; [ - deno rsync + deno rsync netlify-cli ]; }; } diff --git a/package.json b/package.json index b64cb57..7cf48b1 100644 --- a/package.json +++ b/package.json @@ -15,8 +15,9 @@ }, "scripts": { "serve": "http-server ./out -C", - "build": "deno bundle --platform=browser src/*.ts --outdir=out --sourcemap=inline && rsync -av static/ out/", - "build-prod": "deno bundle --platform=browser src/*.ts --outdir=out --minify && rsync -av static/ out/", + "script_index": "deno run --allow-read --allow-write scripts/index.ts", + "build": "deno task script_index && deno bundle --platform=browser src/*.ts --outdir=out --sourcemap=inline && rsync -av static/ out/", + "build-prod": "deno task script_index && deno bundle --platform=browser src/*.ts --outdir=out --minify && rsync -av static/ out/", "test": "deno test test/**/*.ts" } } diff --git a/scripts/index.ts b/scripts/index.ts new file mode 100644 index 0000000..469ab61 --- /dev/null +++ b/scripts/index.ts @@ -0,0 +1,31 @@ +// generates index of html files in static + +let output = ` + + +
+ + +