From 94e248b95eaaca6fbee363ef437f4bd7524da397 Mon Sep 17 00:00:00 2001 From: Fabien Freling Date: Tue, 19 Nov 2024 14:58:12 +0100 Subject: [PATCH 1/4] switch to flake --- flake.lock | 25 +++++++++++++++++++++++++ flake.nix | 19 +++++++++++++++++++ shell.nix | 1 + 3 files changed, 45 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..6bc678b --- /dev/null +++ b/flake.lock @@ -0,0 +1,25 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1731890469, + "narHash": "sha256-D1FNZ70NmQEwNxpSSdTXCSklBH1z2isPR84J6DQrJGs=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5083ec887760adfe12af64830a66807423a859a7", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..b426747 --- /dev/null +++ b/flake.nix @@ -0,0 +1,19 @@ +{ + description = "Website"; + + outputs = { self, nixpkgs }: + let pkgs = nixpkgs.legacyPackages.x86_64-linux; + in { + devShell.x86_64-linux = with pkgs; + mkShell { + nativeBuildInputs = [ + imagemagick + just + libavif + libjxl + pandoc + tup + ]; + }; + }; +} diff --git a/shell.nix b/shell.nix index dcde169..0753dc8 100644 --- a/shell.nix +++ b/shell.nix @@ -5,6 +5,7 @@ pkgs.mkShell { imagemagick just libavif + nushell pandoc tup ]; From 4483828cf5c167fe07f049658f7ab3a6910a6621 Mon Sep 17 00:00:00 2001 From: Fabien Freling Date: Tue, 19 Nov 2024 15:45:15 +0100 Subject: [PATCH 2/4] add jujutsu --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index b43cb21..a9e1de6 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,6 @@ site graph.png /preview + +.jj +.direnv From 381dcd1c1ef41c700559024fcf8f5e744e45fda6 Mon Sep 17 00:00:00 2001 From: Fabien Freling Date: Tue, 19 Nov 2024 15:45:15 +0100 Subject: [PATCH 3/4] remove ubuntu setup --- justfile | 3 --- 1 file changed, 3 deletions(-) diff --git a/justfile b/justfile index 3822e79..36a8e8f 100644 --- a/justfile +++ b/justfile @@ -1,9 +1,6 @@ # vim: set ft=make : root := `pwd` -setup-ubuntu: - sudo apt install fuse3 pandoc - # Build static website build: tup build From 56c240233889a5d5c78eca7bae67035a9ff7de84 Mon Sep 17 00:00:00 2001 From: Fabien Freling Date: Thu, 21 Nov 2024 16:26:54 +0100 Subject: [PATCH 4/4] fix variant path for footer generated file --- Tuprules.tup | 13 +++++++------ templates/Tupfile | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Tuprules.tup b/Tuprules.tup index 744a6ce..3712e6e 100644 --- a/Tuprules.tup +++ b/Tuprules.tup @@ -1,16 +1,17 @@ &root = . -&build_root = build +&tmpl_dir = ./templates +&gen_tmpl_dir = ./build/templates HTML_TEMPLATE = main.html -!html = | &(root)/templates/footer.html \ +!html = | &(tmpl_dir)/ \ |> ^b html %f^ \ pandoc --from markdown --to html \ - --template=&(root)/templates/$(HTML_TEMPLATE) \ + --template=&(tmpl_dir)/$(HTML_TEMPLATE) \ + --include-in-header=&(tmpl_dir)/header.html \ + --include-before-body=&(tmpl_dir)/nav.html \ --css &(root)/css/style.css \ - --include-in-header=&(root)/templates/header.html \ - --include-before-body=&(root)/templates/nav.html \ - --include-after-body=&(build_root)/templates/footer.html \ + --include-after-body=&(gen_tmpl_dir)/footer.html \ %f | sed 's|%%webRoot%%|&(root)|g' > %o \ |> %B.html diff --git a/templates/Tupfile b/templates/Tupfile index 45e0fb0..f179092 100644 --- a/templates/Tupfile +++ b/templates/Tupfile @@ -1 +1 @@ -: |> ./generate_footer.sh > %o |> footer.html +: |> ./generate_footer.sh > %o |> footer.html ./