Files
cv/.githooks/README.md
Alexander Bocken 10048e7611 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
2025-10-27 13:01:45 +01:00

47 lines
1.0 KiB
Markdown

# Git Hooks
This directory contains Git hooks for the CV project.
## Installation
To install the hooks, run:
```bash
.githooks/install-hooks.sh
```
Or, configure Git to use this directory for hooks (Git 2.9+):
```bash
git config core.hooksPath .githooks
```
## Available Hooks
### pre-commit
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. 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)