Skip to content

Commit

Permalink
build proper thumbnails
Browse files Browse the repository at this point in the history
  • Loading branch information
occanowey committed Nov 3, 2024
1 parent 4d5c96b commit 33ab83e
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
system: let
pkgs = import nixpkgs { inherit system; };

nativeBuildInputs = with pkgs; [just minijinja watchexec];
nativeBuildInputs = with pkgs; [just minijinja watchexec imagemagick];
buildInputs = with pkgs; [];
in
with pkgs; {
Expand Down
10 changes: 10 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,23 @@ build:
mkdir -p out
cp -r static/* out/
just render-all
mkdir -p out/images/thumbs/
just build-thumbs

clean:
rm -fr out/*

dev:
watchexec --ignore out -- "just clean; just build"

build-thumbs:
for image in out/images/4k/*.png; do \
magick \
-define png:size=512x512 $image \
-thumbnail 256x256^ -gravity center -extent 256x256 \
$(echo $image | sed "s#4k#thumbs#"); \
done

render-server server:
minijinja-cli templates/server.jinja data/servers/{{ server }}.yaml > out/{{ server }}/index.html

Expand Down
Binary file removed static/images/thumbs/default.png
Binary file not shown.
Binary file removed static/images/thumbs/pv.png
Binary file not shown.
Binary file removed static/images/thumbs/pv2.png
Binary file not shown.
Binary file removed static/images/thumbs/pv_remastered.png
Binary file not shown.
Binary file removed static/images/thumbs/tvl2014.png
Binary file not shown.

0 comments on commit 33ab83e

Please sign in to comment.