source $stdenv/setup # Set up Ruby to use UTF-8 export RUBYOPT="-KU -E utf-8:utf-8" # Copy files to a mutable directory. cp -r $src/* . # We'll generate some static files so make static writable mkdir -p static && chmod -R u+w static # We host some static files (KaTeX CSS in production) on # static.danilafe.com. However, we can just bundle them here instead! # Also, since we're generating and adding a resume further down, add it to # the configuration here as well. echo '[params]' >> config-urls.toml echo 'katexCssUrl = "/katex/katex.min.css"' >> config-urls.toml echo 'normalizeCssUrl = "/normalize/normalize.css"' >> config-urls.toml echo 'visNetworkJsUrl = "/vis-network/vis-network.min.js"' >> config-urls.toml echo 'bergamotJsUrl = "/bergamot/bergamot.js"' >> config-urls.toml echo 'katexJsUrl = "/katex/katex.min.js"' >> config-urls.toml echo 'resumeStaticFile = "/Resume-Danila-Fedorin.pdf"' >> config-urls.toml cp -r $webFiles/* static/ # Build site with Hugo hugo $hugoFlags --config=config.toml,config-urls.toml # Create generated files # Can't do submodules because nix flake inputs get their .git deleted mkdir -p static/graph && ruby ./analyze.rb > static/graph/graph.gen.js # Graph files stork build --input public/index.toml --output static/index.st # Search index cp $resume/Resume-Danila-Fedorin.pdf static/Resume-Danila-Fedorin.pdf # Static folder changed, re-run Hugo hugo $hugoFlags --config=config.toml,config-urls.toml # Output result mkdir $out cp -r public/$publicPath/* $out/ # Render math in HTML and XML files. find $out/ -regex "$out/.*\.html" | xargs katex-html