use env for BLOG_DIR for other shells

This commit is contained in:
James Dixon 2025-03-16 00:57:41 -04:00
parent 5eab5dbad3
commit 0f3f1a0c6b
2 changed files with 14 additions and 0 deletions

View File

@ -79,6 +79,7 @@ alias ltmrc="$EDITOR ~/.local/.tmux.conf"
alias gitrc="$EDITOR ~/.gitconfig" alias gitrc="$EDITOR ~/.gitconfig"
# hugo # hugo
# BLOG_DIR should be set in local env
# BLOG_DIR="$HOME/Code/lemonase.github.io/" # BLOG_DIR="$HOME/Code/lemonase.github.io/"
hugo-cd() { cd $BLOD_DIR; } hugo-cd() { cd $BLOD_DIR; }
hugo-lp() { cd $BLOG_DIR && hugo list all; } hugo-lp() { cd $BLOG_DIR && hugo list all; }

View File

@ -103,6 +103,7 @@ alias ungzip="gunzip"
# Functions * # Functions *
# * * * * * * # * * * * * *
# concat common commands # concat common commands
mkcd() { mkdir -p -- "$1" && cd "$1"; } mkcd() { mkdir -p -- "$1" && cd "$1"; }
cdd() { [ -n "$1" ] && for i in $(seq 1 "$1"); do cd ..; done; } cdd() { [ -n "$1" ] && for i in $(seq 1 "$1"); do cd ..; done; }
@ -311,6 +312,18 @@ if command -v cargo >/dev/null; then
src_rust src_rust
fi fi
# hugo
# BLOG_DIR should be set in local env
hugo-cd() { cd $BLOD_DIR; }
hugo-lp() { cd $BLOG_DIR && hugo list all; }
hugo-ls() { hugo-lp | sed 1d | awk -F',' '{print $1, $(NF-4)}' | column -t; }
hugo-fzf() { hugo-ls | fzf | awk '{print $1}'; }
hugo-np() { cd $BLOG_DIR && hugo new posts/$1.md; }
hugo-npe() { hugo-np $1 && $EDITOR $BLOG_DIR/content/posts/$1.md; }
hugo-rm() { rm "$BLOG_DIR/content/posts/$1.md"; }
hugo-ed() { $EDITOR $(hugo-fzf); }
# * * * * * * * * * * * * # * * * * * * * * * * * *
# MISC $PATH Additions * # MISC $PATH Additions *
# * * * * * * * * * * * * # * * * * * * * * * * * *