feat: added wbp function

This commit is contained in:
Vitor Gonçalves 2023-06-26 03:53:50 -03:00
parent 6939f3fe61
commit 6e7059129b
Signed by: vitorg
GPG Key ID: B90BF113DF56EB41
2 changed files with 12 additions and 0 deletions

11
dot_config/bash/functions Normal file
View File

@ -0,0 +1,11 @@
# vim: ft=sh
wbp() {
blogdir="$HOME/docs/src/web/blog"
read -rp "What is your title? " title
path="$blogdir/content/$(date '+%Y-%m-%d')-$title.md"
"$EDITOR" "$path"
clear; printf "Your blogpost is saved at $path.\n"
}

View File

@ -9,4 +9,5 @@ export GPG_TTY=$(tty)
export EDITOR="nvim" VISUAL="nvim"
source "$HOME/.config/bash/aliases"
source "$HOME/.config/bash/functions"
source "$HOME/.config/bash/prompt"