Hugo is installed on webserver, blog exists in git repository in /home/djbeadle/blog.
The git repository is synchronized via GitHub, for easy editing a copy exists on my laptop.
To author a new blog post on laptop:
- Open MacDown
- Write!
- Save to
/Users/Djbeadle/Sites/blog/content/post/[NEW-POST].md
- Commit [NEW-POST]
./update_blog.sh
update_blog.sh logs in to the webserver using SSH keys, updates the repository, clears the public directory and then updates it with the new content.
#!/bin/bash
git -C /Users/Djbeadle/Sites/blog push
ssh website "
git -C /home/djbeadle/blog pull
cd /home/djbeadle/blog
rm -rf /var/www/blog/*
rm -rf /home/djbeadle/blog/public/
hugo
cp -r /home/djbeadle/blog/public/* /var/www/blog/
"