diff options
author | Stonewall Jackson <stonewall@sacredheartsc.com> | 2023-06-25 09:37:53 -0400 |
---|---|---|
committer | Stonewall Jackson <stonewall@sacredheartsc.com> | 2023-06-25 09:37:53 -0400 |
commit | 2fb089aff9acb935bff37bb8a9d4060b3975d969 (patch) | |
tree | d63a19475b5f482d7ed66845965b57f6794e31bb /Makefile | |
parent | 145ef95236bb375fa5b668ea9ef122b0b4d1f9ea (diff) | |
download | www-2fb089aff9acb935bff37bb8a9d4060b3975d969.tar.gz www-2fb089aff9acb935bff37bb8a9d4060b3975d969.zip |
add makefile target for new posts
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -96,6 +96,15 @@ $(OUTPUT_DIR)/%: $(SOURCE_DIR)/% install: pip install -r requirements.txt +.PHONY: post +post: + @test $${NAME?Post URL component must be set in variable NAME.} +ifeq (,$(wildcard $(SOURCE_DIR)/$(BLOG_DIR)/$(NAME)/index.md)) + mkdir -p "$(SOURCE_DIR)/$(BLOG_DIR)/$(NAME)" + printf -- '---\ntitle: %s\ndate: %s\nsubtitle:\ndescription: \n---\n\n\n' "$(NAME)" "$$(date '+%B %d, %Y')" > $(SOURCE_DIR)/$(BLOG_DIR)/$(NAME)/index.md +endif + $(EDITOR) $(SOURCE_DIR)/$(BLOG_DIR)/$(NAME)/index.md + serve: public cd $(OUTPUT_DIR) && python3 -m http.server |