This page is some detail regarding the setup of this website.
Hosting
I have shared hosting with https://www.reclaimhosting.com/
Reclaim Hosting provides institutions and educators with an easy way to offer their students domains and web hosting that they own and control.
I like their model, I’ve found them responsive and it’s reasonably priced. It’s let me play with various systems (my website was on Wordpress for a long time, but I also ran a wiki instance, I played with Drupal, etc.) through CPanel.
Website writing
Since I moved off Wordpress to quartz (more on Quartz), I’ve also been using Obsidian as the main place I edit and create content.
My Obsidian instance includes a set of plugins, that currently comprises:
Website building
I now build my website on my PC using Quartz, and end up with a set of static html+ files. Those need moving online to be hosted and viewable for the world. I was doing that through FTP for a bit, but it’s very inefficient.
What my workflow now looks like is:
How to sync static built site to server
What that rests on is using a post-receive
script in a git repository hosted in my reclaimhosting space.
This largely reflects the very helpful instructions https://jekyll.polyrhetor.io/ but (a) I’m on Windows, and (b) I found some bits confusing/I did things in a different sequence, so it shows a bit more detail.
Step 1: ideally work out SSH for your reclaimhosting account
Step 2: Setup directories on reclaimhosting space
You can do this either via SSH (using the instructions https://jekyll.polyrhetor.io/ ), or via the CPanel GUI file manager (how I did it).
You need to create three directories:
- Name: gitbare, Description: This’ll hold a ‘bare’ git repository, it’s where the
post-receive
script below will go. - Name: you.com-quartztree, Description: This is where your entire git history for the repo will go
- Name: public_html or a subdomain (preferably), Description: This is your live website
You also need to know:
- What the name of the directory that holds your public built website is (mine is
public
) - If you want to add another directory, what that’s called (and, possible security issues)
Step 3:
Either using SSH or the CPanel terminal, you need to:
- Run
git init --bare
inside the directory gitbare - add the script below (edited) as your
post-receive
inside thehooks
directory (you’ll see there’s a sample in it already)
I did ‘2’ using the browser editor and CPanel file manager.
Make sure to change the two variables at the top so DOMAIN
is where your website will be served from (setup a subdomain in CPanel so it will load from this directory if you need to), and DOMAINTRACKING
is where the git history is.
Step 4:
On your local computer, if you don’t have a repo, make one.
If you do, then you can run:
git remote add live ssh://<polyrhet>@<servername>/~/<webdomain>.git
(changing it for the address for your barerepo
).
You may need to fix branch names or connections.
You’ll see above that I have two (at least) remotes, and I push
To my live website on reclaimhosting, using: git push live content:main
(i.e., my local branch is called content
and the remote server branch is called main
)
And to github using: git push origin content:content