- Add .githooks directory with pre-commit hook for cv.webp generation - Create installation script for hooks setup - Add documentation for hooks usage - Refactor timeline arrows into reusable commands (\timelinearrow and \timelinearrowcontinue) - Simplify arrow usage by only requiring length parameter
34 lines
692 B
Markdown
34 lines
692 B
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 generates `img/cv.webp` from `cv.pdf` when changes are committed.
|
|
|
|
**Requirements:**
|
|
- `pdftoppm` (from poppler-utils)
|
|
- `magick` (ImageMagick)
|
|
|
|
The hook will:
|
|
1. Check if `cv.pdf` is being committed or has been modified
|
|
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
|