summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortdback <tyler@tdback.net>2024-12-15 11:07:30 -0500
committertdback <tyler@tdback.net>2024-12-15 11:07:30 -0500
commit074b7c5361738c81beec7b2b657e752ea543c06e (patch)
treefc7e5b6ca0e94a6de69ed85c1c73cbbcfcce427c
parent0bb075d9c8ea99a6f18d440af6d03c84f17fd23b (diff)
add functions for creating/deleting posts in nix devShell
-rw-r--r--flake.nix14
1 files changed, 14 insertions, 0 deletions
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
+ }
+ '';
};
});
}