mirror of
https://github.com/Smaug123/static-site-pdfs
synced 2025-10-13 11:18:40 +00:00
Add DogeConf talk
This commit is contained in:
23
build.sh
23
build.sh
@@ -1,24 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
USER_DIR=$(readlink -f "$1")
|
||||
WORKDIR=$(mktemp -d -p "$USER_DIR")
|
||||
|
||||
cd "$WORKDIR" || exit 1
|
||||
mkdir "output"
|
||||
|
||||
# Build PDFs from LaTeX. Do the build twice to sort out any bookmarks.
|
||||
# Build PDFs from LaTeX.
|
||||
find "$USER_DIR" -type f -name '*.tex' -print0 | while IFS= read -r -d '' file; do
|
||||
echo ">>> $file"
|
||||
ls -la "$file"
|
||||
output=$(dirname "$file")/$(basename "$file" .tex).pdf
|
||||
output=$(readlink -f "$(dirname "$file")/$(basename "$file" .tex).pdf")
|
||||
if [ -f "$output" ]; then
|
||||
echo "Skipping $file as already built"
|
||||
exit 0
|
||||
else
|
||||
file=$(readlink -f "$file")
|
||||
echo "$file - $output"
|
||||
pushd "$(dirname "$output")" || exit 1
|
||||
# Do the build twice to sort out any bookmarks.
|
||||
HOME=$(pwd) SOURCE_DATE_EPOCH=1622905527 pdflatex "$file" || exit 1
|
||||
HOME=$(pwd) SOURCE_DATE_EPOCH=1622905527 pdflatex "$file" || exit 1
|
||||
popd || exit 1
|
||||
fi
|
||||
echo "$file - $output"
|
||||
HOME=$(pwd) SOURCE_DATE_EPOCH=1622905527 pdflatex "$file" || exit 1
|
||||
HOME=$(pwd) SOURCE_DATE_EPOCH=1622905527 pdflatex "$file" || exit 1
|
||||
mv "$(basename "$output")" "$output" || exit 1
|
||||
done
|
||||
|
||||
cd "$USER_DIR" || exit 1
|
||||
rm -r "$WORKDIR"
|
||||
|
Reference in New Issue
Block a user