diff options
author | tdback <tyler@tdback.net> | 2024-12-15 11:07:30 -0500 |
---|---|---|
committer | tdback <tyler@tdback.net> | 2024-12-15 11:07:30 -0500 |
commit | 074b7c5361738c81beec7b2b657e752ea543c06e (patch) | |
tree | fc7e5b6ca0e94a6de69ed85c1c73cbbcfcce427c | |
parent | 0bb075d9c8ea99a6f18d440af6d03c84f17fd23b (diff) |
add functions for creating/deleting posts in nix devShell
-rw-r--r-- | flake.nix | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -14,6 +14,20 @@ buildInputs = with pkgs; [ hugo ]; + + shellHook = '' + SITE="$HOME/projects/tdback.net" + + new-post() { + hugo new "posts/$1/index.md" + $EDITOR "$SITE/content/posts/$1/index.md" + } + + del-post() { + POST="$SITE/content/posts/$1" + [ -d $POST ] && rm -r $POST + } + ''; }; }); } |