From 6eb036dc21651c2c637701e3cb3286f1d369c8e3 Mon Sep 17 00:00:00 2001 From: Thomas Dehaeze Date: Sun, 27 Sep 2026 19:45:27 +0200 Subject: [PATCH] Add make hugo target to export to the website --- Makefile | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..15a9337 --- /dev/null +++ b/Makefile @@ -0,0 +1,13 @@ +.PHONY: help hugo + +help: + @echo "Usage: make " + @echo " hugo - Export the org files to the Hugo website (~/Sites/website)" + +hugo: + @files=$$(grep -rli --include='*.org' --exclude-dir=.git '^#+hugo_base_dir:' . | sort); \ + if [ -z "$$files" ]; then echo "No Org file with #+hugo_base_dir found"; exit 1; fi; \ + for f in $$files; do \ + echo "==> Exporting $$f"; \ + emacsclient -e "(with-current-buffer (find-file-noselect \"$(CURDIR)/$${f#./}\") (org-hugo-export-wim-to-md))" > /dev/null || exit 1; \ + done