generate articles with makefile

This commit is contained in:
2025-02-11 13:06:37 +01:00
parent bbd34e24ec
commit b7729e5712
2 changed files with 10 additions and 27 deletions

View File

@@ -22,6 +22,16 @@ default += .git/info/exclude
.PHONY: database
database: $(default) ## Make a database for recfiles
.PHONY: article
article: ## Write an article
@path=$$(find . -type d -printf '%P\n' | fzy); \
read -p "Title: " title; \
printf '%s\n' '---' >> $$path/$$title.md ; \
printf 'title: "%s"\n' "$$title" >> $$path/$$title.md ; \
printf 'tags: [ "%s" ]\n' "$$path" | sed 's#\/#", "#g' >> $$path/$$title.md ; \
printf '%s\n\n' '---' >> $$path/$$title.md ;\
$(EDITOR) +5 $$path/$$title.md
.PHONY: clean
clean:
$(RM) $(default)