diff options
Diffstat (limited to 'playbooks.d/www-blog/playbook.bash')
-rw-r--r-- | playbooks.d/www-blog/playbook.bash | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/playbooks.d/www-blog/playbook.bash b/playbooks.d/www-blog/playbook.bash new file mode 100644 index 0000000..e217e73 --- /dev/null +++ b/playbooks.d/www-blog/playbook.bash @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +playbook_add() { + git clone https://git.tyil.nl/blog "$(config www.blog.path)" + + playbook_sync +} + +playbook_sync() { + if [[ $BASHTARD_COMMAND != "add" ]] + then + git -C "$(config www.blog.path)" pull origin "$(config www.blog.branch)" + fi + + chgdir "$(config www.blog.path)" + hugo -D # This will generate all the draft content + hugo # And this will generate the actual live blog, but won't remove the draft content +} + +playbook_del() { + rm -fr -- "$(config www.blog.path)" + + pkg uninstall hugo +} |