Merge pull request 'Merge nix into main: no need for ugly deps fetching anymore.' (#1) from nix into main

Reviewed-on: #1
This commit is contained in:
al 2025-06-16 15:13:23 -04:00
commit 015dfd1769
6 changed files with 29 additions and 68 deletions

1
.gitignore vendored
View file

@ -5,3 +5,4 @@ pgvv/
all_chars.txt all_chars.txt
**/fonts/**/*-Subset.* **/fonts/**/*-Subset.*
woff2/ woff2/
**/serve_*

Binary file not shown.

View file

@ -1,8 +1,14 @@
#!/bin/bash #! /usr/bin/env nix-shell
#! nix-shell -i bash --pure
#! nix-shell -p bash harfbuzz soupault woff2 jotdown python3 --pure
./deps.sh || exit $? if ! [[ -d pgvv/ ]]; then
python3 -m venv pgvv
find acl.cool/serve/ ytheleus.org/serve/ -type f -mmin +11 -delete source ./pgvv/bin/activate
python3 -m pip install --upgrade pip
pip install --upgrade pygments
deactivate
fi
function soup_config { function soup_config {
rm soupault.toml rm soupault.toml
@ -16,7 +22,7 @@ find acl.cool/site/ ytheleus.org/site/ -type f \( -name '*.dj' -o -name '*.html'
cat common_chars.txt >>all_chars.txt cat common_chars.txt >>all_chars.txt
for font in fonts/JuliaMono/*{-Light,-Regular,-SemiBold}{,Italic}.woff2; do for font in fonts/JuliaMono/*{-Light,-Regular,-SemiBold}{,Italic}.woff2; do
./woff2/woff2_decompress "$font" woff2_decompress "$font"
ttf_font="${font%.woff2}.ttf" ttf_font="${font%.woff2}.ttf"
subset_ttf="${ttf_font%.ttf}-Subset.ttf" subset_ttf="${ttf_font%.ttf}-Subset.ttf"
@ -26,7 +32,7 @@ for font in fonts/JuliaMono/*{-Light,-Regular,-SemiBold}{,Italic}.woff2; do
--layout-features='*' \ --layout-features='*' \
--passthrough-tables --passthrough-tables
./woff2/woff2_compress "$subset_ttf" woff2_compress "$subset_ttf"
rm "$subset_ttf" "$ttf_font" rm "$subset_ttf" "$ttf_font"
done done
@ -41,7 +47,7 @@ for font in \
--layout-features='*' \ --layout-features='*' \
--passthrough-tables --passthrough-tables
./woff2/woff2_compress "$subset_ttf" woff2_compress "$subset_ttf"
rm "$subset_ttf" rm "$subset_ttf"
done done
@ -52,10 +58,20 @@ pygmentize -f html -S algol_nu | grep -v 'line-height' >css/code.css
builtin pushd acl.cool builtin pushd acl.cool
soup_config soup_config
soupault soupault
NEXT_DIR="serve_$(date +%s)"
cp -a serve "$NEXT_DIR"
ln -sfn "$NEXT_DIR" serve_
popd popd
builtin pushd ytheleus.org builtin pushd ytheleus.org
soup_config soup_config
soupault soupault
NEXT_DIR="serve_$(date +%s)"
cp -a serve "$NEXT_DIR"
ln -sfn "$NEXT_DIR" serve_
popd popd
deactivate deactivate

View file

@ -1,7 +0,0 @@
@import url(fonts.css);
@import url(looks.css);
@import url(layout.css);
@import url(code.css);

52
deps.sh
View file

@ -1,52 +0,0 @@
#!/bin/sh
if ! [[ -d pgvv/ ]]; then
python3 -m venv pgvv
source ./pgvv/bin/activate
python3 -m pip install --upgrade pip
pip install --upgrade pygments
# pip install --upgrade fonttools
# pip install --upgrade brotli
deactivate
fi
which hb-subset
if ! [[ $? == 0 ]]; then
echo 'please install hb-subset (provided by harfbuzz-devel on RedHat)'
exit 6
fi
which opam 2> /dev/null
if [[ $? == 0 ]]; then
opam install -y soupault
else
echo 'failed to install soupault with opam' >&2
exit 2
fi
which cargo 2> /dev/null
if [[ $? == 0 ]]; then
cargo install jotdown
else
echo 'failed to install jotdown with cargo'
exit 3
fi
which git 2> /dev/null
if ! [[ $? == 0 ]]; then
echo 'you need git'
exit 4
fi
which cc 2> /dev/null
if ! [[ $? == 0 ]]; then
echo 'you need a C compiler'
exit 5
fi
if ! [[ -d woff2/ ]]; then
git clone https://github.com/mobotsar/woff2.git --recursive || exit 7
builtin pushd woff2
make clean all || exit 8
popd
fi

View file

@ -4,7 +4,10 @@
<meta charset="utf-8"> <meta charset="utf-8">
<title> <!-- set automatically, see soupault.conf --> </title> <title> <!-- set automatically, see soupault.conf --> </title>
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/css/index.css"> <link rel="stylesheet" href="/css/fonts.css">
<link rel="stylesheet" href="/css/layout.css">
<link rel="stylesheet" href="/css/looks.css">
<link rel="stylesheet" href="/css/code.css">
<link rel="icon" type="image/png" href="/assets/favicon.png"> <link rel="icon" type="image/png" href="/assets/favicon.png">
<script> <script>
const class_ = `font-${window.devicePixelRatio >= 1.3 ? 'hidpi' : 'lodpi'}`; const class_ = `font-${window.devicePixelRatio >= 1.3 ? 'hidpi' : 'lodpi'}`;