Managing Hugo from two different systems?

Short version: is there a way I can add to my blog from either a Linux or a Windows 10 system, and sync my blog posts between both?

Longer version
I have been very happily using Kaushal Modi’s magical ox-hugo package in Emacs: to add a page to my Hugo site I simply edit the org file which contains all my posts, and then run a script which publishes it to the Hugo site running on my VPS. And this is all within an Arch Linux installation on my laptop.

However, since the current lockdown due to Covid-19 (I’m in Australia) and my remote teaching (I’m an academic), I’ve been working almost exclusively within Windows 10, which although a lesser operating system than linux, fits the University online environment better - all my University systems are Microsoft based.

I’m wondering if there’s a way of writing Hugo posts on the Windows system, and somehow syncing my posts between Windows and Linux? That is, if I want to write a post on my linux system (with ox-hugo) I can, but if I want to write a post on my Windows machine I can do that too. I don’t expect there’d be anything quite as elegant as ox-hugo, but I don’t know. I have found the Windows editor VSCode to be remarkably powerful and useful, even after a lifetime’s emacs. There is a hugo package for VSCode (in fact there seem to be several), but I haven’t explored them yet.

But the issue is not just writing posts, but syncing them.

Thank you very much!

Short answer: git

Long answer is off-topic to this forum, but we have a list of Recommended Reading Reference

2 Likes

Many thanks, I’ll start looking around. I have a somewhat strained relationship with git; last time I tried to sync some material I manage to lose almost everything. Somehow - and I have no idea how - I managed to inform git that what I had was not part of the master fork, so it obligingly deleted it for me. Most of what I lost were images I’d spent a long time formatting to fit a display. I don’t really need version control for something as simple as a blog written by one person - all I really need is a way of syncing my posts between different systems in a way that a post written on one will appear on all other systems.

But if git is the way to go, I’ll grit my teeth, straighten my back, take a deep breath and dive in.

Thank you again.

Ouch! Yeah, git can be a pain to get into. As an alternative, you could try and play around with putting your site code into Google Drive / Dropbox or a similar service. I haven’t tested this personally, so I would be curious about the workflow if you did decide to try and were able to make it work.

Edit: Here’s a post about using Dropbox / IPhone. I use neither, so not personally tested.

Or you could setup a CMS like forestry.io. Although forestry.io uses git, once it’s setup it does all the work for you.

I actually run Nextcloud on my VPS, which works fine. My main issue is to have a two-way sync between my Hugo website and its org files on my laptop, and between the website and whatever I set up on my Windows box. Anyway, there are many options… too many for comfort! But I’ll keep looking.

Thank you again for your advice.