From 074b7c5361738c81beec7b2b657e752ea543c06e Mon Sep 17 00:00:00 2001 From: tdback Date: Sun, 15 Dec 2024 11:07:30 -0500 Subject: add functions for creating/deleting posts in nix devShell --- flake.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/flake.nix b/flake.nix index 857f4fe..570f9cc 100644 --- a/flake.nix +++ b/flake.nix @@ -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 + } + ''; }; }); } -- cgit v1.2.3