8631f7f7db
Web server will set MIME type correctly if file ends with .rss
32 lines
796 B
Makefile
32 lines
796 B
Makefile
BUILD_DIR = /home/ruben/dwn/midgard
|
|
|
|
BLOG ::= $(sort $(wildcard blog/*.md))
|
|
BLOG_HTML ::= $(BLOG:%.md=$(BUILD_DIR)/%.html)
|
|
|
|
PYTHON ::= venv/bin/python
|
|
|
|
.PHONY: all clean public
|
|
|
|
all: $(BUILD_DIR)/index.html $(BUILD_DIR)/blog.rss $(BUILD_DIR)/syntax.css public $(BLOG_HTML)
|
|
|
|
$(BUILD_DIR)/index.html: templates/index.html $(BLOG) page.py
|
|
@mkdir -p "$(@D)"
|
|
$(PYTHON) page.py --index "$<" $(BLOG) > "$@"
|
|
|
|
$(BUILD_DIR)/blog.rss: $(BLOG) rss.py page.py
|
|
@mkdir -p "$(@D)"
|
|
$(PYTHON) rss.py $(BLOG) > "$@"
|
|
|
|
$(BUILD_DIR)/blog/%.html: blog/%.md templates/blog.html page.py
|
|
@mkdir -p "$(@D)"
|
|
$(PYTHON) page.py "$<" > "$@"
|
|
|
|
$(BUILD_DIR)/syntax.css: makefile
|
|
@mkdir -p "$(@D)"
|
|
$(PYTHON) -m pygments -S rainbow_dash -f html > "$@"
|
|
|
|
public:
|
|
cp -rt "$(BUILD_DIR)" public/.
|
|
|
|
clean:
|
|
rm -rf "$(BUILD_DIR)"
|