From 673ac6b90e1ee83fa03fb4c91f0e045181f20c16 Mon Sep 17 00:00:00 2001 From: ktyl Date: Thu, 15 Dec 2022 20:14:09 +0000 Subject: [PATCH] include images in build pipeline --- makefile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/makefile b/makefile index 4740b3b..5aab438 100644 --- a/makefile +++ b/makefile @@ -17,6 +17,7 @@ BLOG_TMP_DIR = .blogtmp PAGES = $(shell find $(ROOT_DIR) -wholename "$(ROOT_DIR)*.html") STYLES = $(shell find $(ROOT_DIR) -wholename "$(ROOT_DIR)*.css") BLOG_PAGES = $(shell find $(BLOG_SRC_DIR) -wholename "$(BLOG_SRC_DIR)*.md") +BLOG_IMAGES = $(shell find $(BLOG_SRC_DIR) -wholename "$(BLOG_SRC_DIR)*.png" -o -wholename "$(BLOG_SRC_DIR)*.jpg") IMAGES = $(shell find $(IMG_DIR) -wholename "$(IMG_DIR)/*.png") @@ -27,6 +28,8 @@ BLOG_INDEX = $(OUT_DIR)/blog.html BLOG_RSS = $(BLOG_OUT_DIR)/index.xml BLOG_INDEX_LINKS = $(BLOG_TMP_DIR)/blogindexlinks.html BLOG_TARGETS = $(BLOG_PAGES:$(BLOG_SRC_DIR)/%.md=$(BLOG_OUT_DIR)/%.html) +BLOG_PNG_TARGETS = $(BLOG_IMAGES:$(BLOG_SRC_DIR)/%.png=$(BLOG_OUT_DIR)/%.png) +BLOG_JPG_TARGETS = $(BLOG_IMAGES:$(BLOG_SRC_DIR)/%.jpg=$(BLOG_OUT_DIR)/%.jpg) HTML_TARGETS = $(PAGES:$(ROOT_DIR)/%.html=$(OUT_DIR)/%.html) CSS_TARGETS = $(STYLES:$(ROOT_DIR)/%.css=$(OUT_DIR)/%.css) @@ -52,7 +55,13 @@ $(OUT_DIR)/%.css: $(ROOT_DIR)/%.css $(CSS_INCLUDES) | $(OUT_DIR) $(OUT_DIR): mkdir -p $@ -blog: $(BLOG_TARGETS) $(BLOG_RSS) | $(BLOG_TMP_DIR) +$(BLOG_OUT_DIR)/%.png: $(BLOG_SRC_DIR)/%.png + cp $< $@ + +$(BLOG_OUT_DIR)/%.jpg: $(BLOG_SRC_DIR)/%.jpg + cp $< $@ + +blog: $(BLOG_TARGETS) $(BLOG_PNG_TARGETS) $(BLOG_JPG_TARGETS) $(BLOG_RSS) | $(BLOG_TMP_DIR) $(BLOG_RSS): $(BLOG_PAGES) pipenv run python scripts/mkblogrss.py $(BLOG_PAGES) > $@