Update with subsetting scripts

This commit is contained in:
Danila Fedorin 2025-02-23 21:07:14 +00:00
parent b0ca0f3916
commit d25e8219f2
3 changed files with 22 additions and 11 deletions

View File

@ -34,11 +34,15 @@ cp -r $agdaHtml/* code/
# Static folder changed, re-run Hugo
hugo $hugoFlags --config=config.toml,config-urls.toml
# Output result
mkdir $out
cp -r public/$publicPath/* $out/
# Do post-processing of HTML files: render math and link up Agda code
htmlfiles=$(find $out/ -regex "$out/.*\.html")
# Do post-processing of HTML files: render math, link up Agda code, subset fonts and icons
gendir="public/$publicPath"
htmlfiles=$(find $gendir/ -regex "$gendir/.*\.html")
chmod -R u+w $gendir
echo $htmlfiles | xargs ${gems}/bin/bundle exec ${ruby}/bin/ruby ./convert.rb --katex-js-file static/katex/katex.min.js
echo $htmlfiles | xargs ${gems}/bin/bundle exec ${ruby}/bin/ruby ./agda.rb
echo $htmlfiles | xargs ${gems}/bin/bundle exec ${ruby}/bin/ruby ./chatgpt-subset-feather-icon.rb $gendir/feather-sprite.svg
echo $htmlfiles | xargs python3 chatgpt-subset-one-go.py $gendir
# Output result
mkdir $out
cp -r $gendir/* $out/

8
flake.lock generated
View File

@ -23,11 +23,11 @@
"blog-source": {
"flake": false,
"locked": {
"lastModified": 1735245303,
"narHash": "sha256-dqBLJ456fQtTwL594j3265ctqALan0PzrWreu2qpT2w=",
"lastModified": 1740345918,
"narHash": "sha256-FVG/2NXiKJAxmvQJCqzK7GVOFu/NkN/L2x0ndMDAfEk=",
"ref": "refs/heads/master",
"rev": "7130c6bd1124dd048d2ede082e3502d8924b8939",
"revCount": 899,
"rev": "11be991946cb8e6d0d710077fc6478e782fdfc94",
"revCount": 909,
"submodules": true,
"type": "git",
"url": "https://dev.danilafe.com/Web-Projects/blog-static.git"

View File

@ -14,6 +14,13 @@ let
gemset = ./gemset.nix;
};
pythonEnv = python3.withPackages (python-pkgs: [
python-pkgs.beautifulsoup4
python-pkgs.lxml
python-pkgs.fonttools
python-pkgs.brotli
]);
# --- Building Agda HTML ---
agdaEnv = agda.withPackages [ agdaPackages.standard-library ];
agdaHtml = settings:
@ -52,7 +59,7 @@ let
gems = gems settings;
agdaHtml = agdaHtml settings;
buildInputs = [
hugo ruby stork agdaEnv
hugo ruby stork agdaEnv pythonEnv
];
};
in