diff --git a/config/bash/.local/bin/hu b/config/bash/.local/bin/hu index dd486e5..f779bd1 100755 --- a/config/bash/.local/bin/hu +++ b/config/bash/.local/bin/hu @@ -5,19 +5,22 @@ # Relies on BLOG_DIR to be set from environment hu() { - echo "$BLOG_DIR" if [ "$1" == "np" ]; then POST_NAME="$2" if [ -z "$POST_NAME" ]; then read -p "Enter a post title (omitting .md): " POST_NAME fi - hugo new posts/$POST_NAME.md; + hugo new -s "$BLOG_DIR" posts/$POST_NAME.md; fi if [ "$1" == "rm" ]; then rm "$BLOG_DIR/content/posts/$2.md" fi + if [ "$1" == "dir" ]; then + echo "$BLOG_DIR" + fi + if [ "$1" == "ls" ]; then hugo list all -s "$BLOG_DIR" | sed 1d | awk -F',' '{print $1, $(NF-4)}' | column -t fi