I do something similar but I round-trip everything through GitHub. So basically I update my Hugo site on my computer, push the changes to github, then I pull those changes from Github down to my shared hosting account. I have a script that does all of this in basically one step.
That being said, what you’ve asked about should be possible. I’ve never personally used this feature in cPanel, but cPanel does have the ability to host git repositories, so you can host a git repository directly on your account:
You’ll need your cPanel credentials when cloning the repo to your local computer, and those can be found here:
I am following this discussion with eager interest. I’m currently running a Jekyll-based site in GitHub pages, as well as a reveal.js site for my presentations, and would love not to be dependent on GitHub…
It could work for that too, given the caveat that you’ll need to use jekyll build to still build the site locally. Our shared hosting accounts don’t have the capability to run Ruby stuff. Ultimately I think this would be relatively minor though your workflow could be:
write a blog post
commit and push your changes (including the built out website)
The only trick here is you’ll need to make sure permissions are good and the directory jekyll builds the site out to is set as your web root. Or maybe it might be easier to set up some kind of symlink or script to copy files to the web root. Again, I haven’t tested any of this yet, also I don’t currently use jekyll for any of my sites.
I do something similar for my blog with hugo except that in that case it does get built on the server, because hugo doesn’t have that ruby dependency. Hosting the actual repository in cPanel could be interesting, but I think at the moment at least, I enjoy Github’s web UI too much to give that piece up.
Yeah sorry I don’t think I went into enough detail. The key is to be generated on your computer, and ssh-copy-id will set the key up for use on the server. That being said, if you are able to ssh into your account you should be set there.
Stay tuned, Kathleen… I began with the Itsiest, Bitsiest Eleventy Tutorial which suits my minimalist aesthetic very nicely. I now have built a blog that looks like 1995, and it’s all downhill (uphill?) from here. This is probably off-topic for here at this point, so I’ll keep you posted via Mastodon…
Thanks, Helen! It’s awesome to see this written down – especially the git setup, which is also where I “got stuck on this for SO LONG.” I especially appreciate where you’ve said “nb All the stuff in this section happens on your server, not your laptop” – that’s exactly where I get messed up every time
The version of this I ended up with is a little simpler, because there is only one branch, and so no post-receive hooks… I have my local dev environment in a Sync.com (aka not Dropbox) folder on my laptop, so that gives me my backup, and so it’s just the static site that I push to Reclaim.
I am actively running this now, and am working towards announcing this publicly, but FWIW here’s Imaginary Text, in progress… Eleventy, pushed straight to Reclaim.