diff options
author | Vitor Gonçalves <vitorg@tilde.team> | 2023-06-26 03:53:50 -0300 |
---|---|---|
committer | Vitor Gonçalves <vitorg@tilde.team> | 2023-06-26 03:53:50 -0300 |
commit | 6e7059129b385b0aee732960903b2faab98e167c (patch) | |
tree | 4b19b31c303f50f9ecf1fed42e612809b7199a34 /dot_config/bash | |
parent | 6939f3fe61e1696dc11603451d786f0990ffdbc2 (diff) | |
download | dots-6e7059129b385b0aee732960903b2faab98e167c.tar.gz |
feat: added wbp function
Diffstat (limited to 'dot_config/bash')
-rw-r--r-- | dot_config/bash/functions | 11 | ||||
-rw-r--r-- | dot_config/bash/rc | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/dot_config/bash/functions b/dot_config/bash/functions new file mode 100644 index 0000000..c0f45fb --- /dev/null +++ b/dot_config/bash/functions @@ -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" +} diff --git a/dot_config/bash/rc b/dot_config/bash/rc index 40a6b72..f8f7b01 100644 --- a/dot_config/bash/rc +++ b/dot_config/bash/rc @@ -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" |