This repository has been archived on 2023-02-07. You can view files and clone it, but cannot push or open issues or pull requests.
hkis-au-campus-du-libre-2022/Makefile

36 lines
598 B
Makefile

SRCS := $(sort $(wildcard *.md))
DEST := $(notdir $(PWD))
.PHONY: static
static: output/index.html
cp -a static/ output/
%.html: %.md
sed 's/#!//e;' $< | mdtoreveal /dev/stdin --output $@
output/index.md: $(SRCS)
mkdir -p output
cat $(SRCS) > output/index.md
.PHONY: publish
publish: static
rsync -vah --delete output/ mdk@mdk.fr:/var/www/mdk.fr/$(DEST)/
.PHONY: clean
clean:
rm -fr output
.PHONY: entr
entr:
ls -1 *.md | entr $(MAKE) static
.PHONY: serve
serve: static
python3 -m http.server -d output/
.PHONY: test
test:
if [ -f test.py ]; then \
python test.py *.md; \
fi