37 lines
982 B
Makefile
37 lines
982 B
Makefile
# 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
|
|
default: build-gemini publish-gemini build-html publish-html
|
|
|
|
gemini/%.gmi: content/%.md
|
|
cat $< | md2gmn > $@
|
|
|
|
gemini/index.gmi: $(source_files)
|
|
cp gemini/_index.gmi_ gemini/index.gmi
|
|
for file in $(target_files) ; do \
|
|
echo "=> $$file" | sed 's/gemini//' >> gemini/index.gmi ; \
|
|
done
|
|
|
|
.PHONY: build-gemini
|
|
build-gemini: $(target_files) gemini/index.gmi
|
|
|
|
.PHONY: build-html
|
|
build-html:
|
|
boot publish
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
echo ${target_files}
|
|
|
|
.PHONY: publish-gemini
|
|
publish-gemini: ${target_files}
|
|
rsync -av content/img content/extra gemini/index.gmi $^ gemini.bgenc.net:/var/gemini/
|
|
|
|
.PHONY: publish-html
|
|
publish-html:
|
|
rsync -av docs/ /var/www/
|