1
0
Fork 0
website/Makefile

37 lines
982 B
Makefile
Raw Normal View History

2022-03-13 16:50:27 -05:00
# This makefile builds the website to be published.
# For the HTTP/HTML portion, that's pushed to Github pages.
# For the gemini portion, that's also pushed to my gemini server by this makefile.
source_files := $(shell find content/*.md)
target_files := $(patsubst content/%.md,gemini/%.gmi,$(source_files))
.PHONY: default
2022-04-03 17:17:04 -05:00
default: build-gemini publish-gemini build-html publish-html
2022-03-13 16:50:27 -05:00
gemini/%.gmi: content/%.md
cat $< | md2gmn > $@
2022-03-13 16:50:27 -05:00
2022-03-18 03:19:08 -05:00
gemini/index.gmi: $(source_files)
cp gemini/_index.gmi_ gemini/index.gmi
2022-03-13 16:50:27 -05:00
for file in $(target_files) ; do \
echo "=> $$file" | sed 's/gemini//' >> gemini/index.gmi ; \
done
2022-03-18 03:19:08 -05:00
.PHONY: build-gemini
build-gemini: $(target_files) gemini/index.gmi
2022-03-13 16:50:27 -05:00
.PHONY: build-html
build-html:
boot publish
.PHONY: clean
clean:
echo ${target_files}
2022-04-03 17:17:04 -05:00
.PHONY: publish-gemini
2022-04-02 14:55:37 -05:00
publish-gemini: ${target_files}
2022-03-13 16:50:27 -05:00
rsync -av content/img content/extra gemini/index.gmi $^ gemini.bgenc.net:/var/gemini/
2022-04-03 17:17:04 -05:00
.PHONY: publish-html
publish-html:
rsync -av docs/ /var/www/