fix mark article target

This commit is contained in:
Malin Freeborn 2025-02-12 15:37:05 +01:00
parent b6280a8581
commit 37df47cf3b
Signed by: andonome
GPG Key ID: 52295D2377F4D70F

View File

@ -43,11 +43,12 @@ database: $(default) ## Make a recfiles database
article: ## Write an article article: ## Write an article
@path=$$(find . -type d -printf '%P\n' | $(FZF)) ;\ @path=$$(find . -type d -printf '%P\n' | $(FZF)) ;\
read -p "Title: " title ;\ read -p "Title: " title ;\
printf '%s\n' '---' >> $$path/$$title.md ; \ filename="$$(echo "$$title" | tr '[:upper:]' '[:lower:]' | tr ' ' '_')" ;\
printf 'title: "%s"\n' "$$title" >> $$path/$$title.md ; \ printf '%s\n' '---' >> $$path/$$filename.md ;\
printf 'tags: [ "%s" ]\n' "$$path" | sed 's#\/#", "#g' >> $$path/$$title.md ; \ printf 'title: "%s"\n' "$$title" >> $$path/$$filename.md ;\
printf '%s\n\n' '---' >> $$path/$$title.md ;\ printf 'tags: [ "%s" ]\n' "$$path" | sed 's#\/#", "#g' >> $$path/$$filename.md ;\
$(EDITOR) +5 $$path/$$title.md printf '%s\n\n' '---' >> $$path/$$filename.md ;\
$(EDITOR) +5 "$$path/$$filename.md"
.PHONY: clean .PHONY: clean
clean: ## Remove all generated files clean: ## Remove all generated files