+# usage: build_page [page_template] [item_template] [display_message]
+define build_page
+ echo "$(3)"
+ $(export_common)
+ cat $(TEMPLATE_DIR)/$(1) > "$@"
+ $(call loop_article,"$@",$(2))
+ envsubst < "$@" | sponge "$@"
+endef
+
+.ONESHELL:
+$(BUILD_DIR)/rolling.html:
+ $(call build_page,rollingpage.template.html,rollingitem.template.html,building rolling file)
+
+.ONESHELL:
+$(BUILD_DIR)/archive.html:
+ $(call build_page,archivepage.template.html,archiveitem.template.html,building archive file)
+
+.ONESHELL:
+$(BUILD_DIR)/feed.xml:
+ $(call build_page,feed.template.xml,feeditem.template.xml,building feed file)
+
+.ONESHELL:
+$(BUILD_DIR)/$(ARTICLE_PATH)/%.html: $(SRC_DIR)/%.md
+ echo "parsing $<"
+ $(export_common)
+ $(call export_article,"$<")
+ cat $(TEMPLATE_DIR)/articlepage.template.html > "$@"
+ # module pipeline starts here
+ ./$(MODULE_DIR)/md "$<" | sed -i "/<!-- _MOUNT_ARTICLECONTENT -->/r /dev/stdin" "$@"
+ . ./$(MODULE_DIR)/md-header "$<"
+ . ./$(MODULE_DIR)/readingtime "$<"
+ # module pipeline ends here
+ envsubst < "$@" | sponge "$@"