Skip to content

Commit d627bea

Browse files
committed
feat(hugo): add aliases for creating hugo posts
1 parent d81de18 commit d627bea

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

.zsh/apps/hugo.zsh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
postde() {
2+
if [ -z "$1" ]; then
3+
echo "Missing the post title"
4+
return 1
5+
fi
6+
file="$(echo "$@.md" | tr ' ' -)"
7+
8+
cd ~/code/blog
9+
hugo new content "$file"
10+
mv "content/en/$file" content/de/blog/
11+
$EDITOR "content/de/blog/$file"
12+
}
13+
posten() {
14+
if [ -z "$1" ]; then
15+
echo "Missing the post title"
16+
return 1
17+
fi
18+
file="$(echo "$@.md" | tr ' ' -)"
19+
20+
cd ~/code/blog
21+
hugo new content "blog/$file"
22+
$EDITOR "content/en/blog/$file"
23+
}

0 commit comments

Comments
 (0)