From d9f3d64c551b434bb55a1d0106c9d3a617f28613 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Tue, 12 Nov 2024 00:29:59 +0100 Subject: [PATCH] add makefile --- .gitignore | 13 ++++++++++++- data/blog/posts/Makefile | 20 ++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 data/blog/posts/Makefile diff --git a/.gitignore b/.gitignore index cadb5ef..e5d75c4 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,15 @@ docker-compose.yml /.vscode -/data + +# Data +data/index.md + +data/contacts/* +data/cours/* +data/projects/* + +# Blog +data/blog/*.md +data/blog/posts/* +!data/blog/posts/Makefile diff --git a/data/blog/posts/Makefile b/data/blog/posts/Makefile new file mode 100644 index 0000000..ce7d29d --- /dev/null +++ b/data/blog/posts/Makefile @@ -0,0 +1,20 @@ +MKDIR = mkdir -p +TOUCH = touch +PRINT = echo + +DATE = $(shell date '+%d-%m-%Y') + +DIR = $(shell date '+%Y/%m') +FI := new + +new: + $(MKDIR) $(DIR) 2> /dev/null + $(TOUCH) $(DIR)/$(FI).md + $(PRINT) "---" > $(DIR)/$(FI).md + $(PRINT) "publish: false" >> $(DIR)/$(FI).md + $(PRINT) "date: $(DATE)" >> $(DIR)/$(FI).md + $(PRINT) "draft: true" >> $(DIR)/$(FI).md + $(PRINT) "---" >> $(DIR)/$(FI).md + +help: + $(PRINT) "make FI=new"