about summary refs log tree commit diff
diff options
context:
space:
mode:
authoruser <user@node5.net>2024-03-11 18:20:39 +0100
committeruser <user@node5.net>2024-03-11 18:20:39 +0100
commite1c14e4692fab5d00736bdf390c4dbb31f50bb11 (patch)
treed20fc69a71a1dd5061cb7cb57b6aa2a11ddcd4e7
parentbdca0ed9a34d8f0de4af695120d52d00508905cc (diff)
readme - hooks
-rw-r--r--README.md31
1 files changed, 28 insertions, 3 deletions
diff --git a/README.md b/README.md
index be2d6c2..18e07c3 100644
--- a/README.md
+++ b/README.md
@@ -1,14 +1,39 @@
+This repo has a [sub repo containing the article source files](https://git.node5.net/blog/articles/)
+, run this to initialize it
+```bash
+git submodule sync --init
+```
+
+There's git hooks to automatically update,
+and
+restart service if code was changed,
+or
+reload service if articles were changed
+it reloads by sending POSIX `SIGHUP` (`1`) IPC signal (see `man 7 signal`)
+
+
+Validate article source compiles to HTML as a 
+[git pre-commit hook](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks#_committing_workflow_hooks)
 
-Validate article source compiles to HTML before reloading service
 ```bash
 python3 src/blog_node5_net.py validate
+
 ```
+This can be added to `.git/hooks/pre-commit` to test before commiting articles
 
-SystemD service supports reloading of the articles from source
 ```bash
-sudo systemctl reload blog.node5.net.service
+cd blog.node5.net/articles
+git rev-parse --git-path hooks
 ```
 
+Now the folling can be added to `.git/modules/blog.node5.net/articles/hooks`
+
+```bash
+#!/bin/sh
+cd ../../ && venv/bin/python src/blog_node5_net.py validate
+```
+
+
 ### TODO
 - [Caching](https://flask-caching.readthedocs.io/en/latest/)
 - Breadcrumbs