Uploading Content to the Blog

Reading time: 2 minutes (262 words)
Author: @pugmiester
Tags: blog , site , selfhosted

It shouldn’t be this difficult, but I’m having one of those days where eveything seems to be more complicated than it should so I’m asking the Fediverse for some best practice advice, before I accidentally set everything on fire.

Best Practice from Mastodon

In essence, I’m looking for whatever is todays best practice for uploading the new site to my web server. Making the blog users home directory the web source directory under /var/www/htdocs seems like it should work, I did this for my old web server back in the day, but the big question is, is that the best way to handle it or am I missing something really obvious.

I’d rather not make a complete hash of things at this stage, hence asking the question.

UPDATE: We’re up and running with help from the Fediverse and a lot more searching for syntax reminders.

I have a symbolic link between a “public” folder in my users home directory that points to the web root for this blog. This lets me log in with my web users account and upload the new contents into “public” and it appears, like magic, in the web root for this blog and hay presto, we have a live site.

I’m using rsync with the “–delete-after” flag set to push content to the server and cleanup anything that’s been removed locally.

Note to self, remember to add “hugo” into your deploy.sh script after you’ve cleared out the local public folder or you find that all of your content disappears from the webserver. Ask me how I know….