Hugo and Drone Simplified
What if for whatever reason it isn’t possible (or desirable) to run Hugo on the
machine hosting your blog?
If this were the case, the system described in previous posts can still be used,
albeit a little differently.
The steps required would be:
- Generate the blog locally
- Clean up the remote repository
- Modify
.gitignore
- Modify Drone pipeline
- Add the generated site to git
Generating the site locally is the easiest thing. Just run the hugo
command on
the blog’s root directory. This will create the public
directory, with the
rendered version.
To clean up the remote repository run the command git rm -r --cached content/ static/ layouts/ archetypes/ config.toml
. This is just for the sake of
cleanliness, having these directories under version control isn’t strictly
necessary anymore. They could also be put on a separate branch, but I won’t go
into that.
Take out public
from .gitignore
and add in the other directories like so:
resources/
content/
static/
layouts/
archetypes/
config.toml
Amend the Drone pipeline:
---
(rest of the file)
steps:
- name: deploy
commands:
- cd /home/me/myBlog
- git pull origin blog
- cp -Rf public/* /home/me/public_html
(do the gopher stuff, if necessary)
- rm -r public
The gopher integration steps remain the same.
Now all there’s to do is git add public
, write the commit message and push.