'Auto-Upload Contents Of Jekyll '_site' folder to remote on build?

I'm building my blog in Jekyll in VSCode. I'm trying to set up my workflow so that building the project automatically uploads the contents of the '_site' folder to a remote folder on my web server (let's call it http://example.com/blog). I'm running into a few issues connecting all this up.

The biggest issue is setting up a VSCode FTP extension to work with a Jekyll project. I had been using ftp-kr, which did work - however, it uploads the whole '_site' folder onto my web server, rather than just its contents. This means that my site is now at http://example.com/blog/_site.

I've tried initialising ftp-kr in the _site folder itself, but every time the project is built, Jekyll deletes the JSON that holds ftp-kr's settings.

So, to conclude: I want a way to just upload the contents of the '_site' folder via FTP to a remote folder on build... ideally using VSCode!

Any help is appreciated.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source