gemspace/journal/20230416-re-my-create-artic...

34 lines
1.6 KiB
Plaintext

# RE: my create article script
In reply to:
=> gemini://yretek.com/english/2023-04-15_My_create_article_script.en.gmi Yretek - My create article script
My capsule has a Makefile in the root. One of the targets of that file is "journal".
``` Makefile
journal: ## create new journal post
@test -n "$(title)" || read -p "Enter a title for your journal: " title; \
export post_date=$(shell date +"%Y-%m-%d"); \
export post_date_slug=$(shell date +"%Y%m%d"); \
export title_slug=$$post_date_slug-`echo $${title:-Untitled} | sed -E -e 's/[^[:alnum:]]/-/g' -e 's/^-+|-+$$//g' | tr -s '-' | tr A-Z a-z`; \
export post_path=journal/$$title_slug.gmi; \
printf "# %s\n" "$$title" > $$post_path; \
printf "\n\n" >> $$post_path; \
printf "Originally Published %s at:\n" "$$post_date" >> $$post_path; \
printf "gemini://tilde.team/~tomasino/%s\n" "$$post_path" >> $$post_path; \
printf "\n" >> $$post_path; \
printf "If you have questions or thoughts to add" >> $$post_path; \
printf " please send me a link to your response.\n" >> $$post_path; \
printf "=> /~tomasino/about.txt Contact Information" >> $$post_path; \
vim $$post_path
```
I made a similar one for my new film reviews section as well. After writing I manually update my index pages and my Atom feed.
Originally Published 2023-04-16 at:
gemini://tilde.team/~tomasino/journal/20230416-re-my-create-article-script.gmi
If you have questions or thoughts to add please send me a link to your response.
=> /~tomasino/about.txt Contact Information