Files
2026-10-12 13:25:46 +02:00

14 lines
520 B
Makefile

.PHONY: help hugo
help:
@echo "Usage: make <command>"
@echo " hugo - Export the org files to the Hugo website (org-hugo-base-dir)"
hugo:
@files=$$(grep -rli --include='*.org' --exclude-dir=.git '^#+hugo_section:' . | sort); \
if [ -z "$$files" ]; then echo "No Org file with #+hugo_section 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