Add LaTeX compilation and post-push sync hooks

- Update pre-commit hook to compile cv.tex and cv_de.tex before generating webp
- Add post-push hook to rsync PDFs to bocken.org:/var/www/static/
- Update documentation with new hook requirements and functionality
This commit is contained in:
2025-10-27 13:01:45 +01:00
parent 9cec37d7ea
commit 10048e7611
3 changed files with 126 additions and 34 deletions

View File

@@ -20,14 +20,27 @@ git config core.hooksPath .githooks
### pre-commit
Automatically generates `img/cv.webp` from `cv.pdf` when changes are committed.
Automatically compiles LaTeX files and generates WebP preview image.
**Requirements:**
- `pdflatex` (from TeX Live or similar LaTeX distribution)
- `pdftoppm` (from poppler-utils)
- `magick` (ImageMagick)
The hook will:
1. Check if `cv.pdf` is being committed or has been modified
1. Compile `cv.tex` and `cv_de.tex` to PDF if they've been modified or staged
2. Convert the first page of `cv.pdf` to a WebP image
3. Save it as `img/cv.webp`
4. Add the generated image to the commit
### post-push
Automatically syncs compiled PDFs to bocken.org after pushing.
**Requirements:**
- `rsync`
- SSH access to `root@bocken.org`
The hook will:
1. Upload `cv.pdf` to `root@bocken.org:/var/www/static/`
2. Upload `cv_de.pdf` to `root@bocken.org:/var/www/static/` (if exists)