blog/makefile

33 lines
713 B
Makefile
Raw Normal View History

2022-04-16 20:46:09 +02:00
SRC_DIR = ./blogs
OUT_DIR = out/
HTML_DIR = $(OUT_DIR)html
GEMINI_DIR = $(OUT_DIR)gemini
MAKE_GEMINI = build/markdown2gemini.py
MAKE_HTML = build/markdown2html.py
2023-03-11 13:16:38 +01:00
MAKE_RSS = build/rss.py
2022-04-16 20:46:09 +02:00
PAGES = $(shell find $(SRC_DIR) -wholename "$(BLOG_SRC_DIR)*.md")
HTML_TARGETS = $(PAGES:$(SRC_DIR)/%.md=$(HTML_DIR)/%.html)
2023-03-11 13:16:38 +01:00
HTML_RSS = $(HTML_DIR)/index.xml
2022-04-16 20:46:09 +02:00
GEMINI_TARGETS = $(PAGES:$(SRC_DIR)/%.md=$(GEMINI_DIR)/%.gmi)
_dummy := $(shell mkdir -p $(HTML_DIR) $(GEMINI_DIR))
$(HTML_DIR)/%.html: $(SRC_DIR)/%.md
python $(MAKE_HTML) $< $@
2023-03-11 13:16:38 +01:00
$(HTML_RSS): $(PAGES)
pipenv run python $(MAKE_RSS) $(PAGES) > $@
html: $(HTML_TARGETS) $(HTML_RSS)
2022-04-16 20:46:09 +02:00
echo $(HTML_TARGETS)
gemini:
all: html gemini
clean:
rm -r $(OUT_DIR)