1
Fork 0
mirror of https://github.com/RGBCube/NixSite synced 2025-07-29 08:37:45 +00:00

Initial commit

This commit is contained in:
RGBCube 2024-02-28 13:59:54 +03:00
parent c69b2eda1e
commit b5ee8e239d
No known key found for this signature in database
4 changed files with 59 additions and 0 deletions

22
build.sh Executable file
View file

@ -0,0 +1,22 @@
#!/bin/sh
set -e # Fail fast.
rm -rf _site
# Creates all dirs needed.
for dir in $(find site -type d); do
mkdir -p "_$dir"
done
for file in $(find site -type f); do
if [[ ! "${file##*/}" =~ ^_ ]]; then
if [[ "$file" =~ .nix$ ]]; then
echo "Processing file $file to _${file%.nix}.html..."
TARGET_FILE=$(realpath "$file") nix eval "${HTMNIX_REF:-github:RGBCube/HTMNIX}#result" --impure --raw --apply toString > "_${file%.nix}.html"
else
echo "Copying file $file to _$file..."
cp "$file" "_$file"
fi
fi
done