Neocities Batch Upload

Here’s how you can batch upload new sites/changes to your neocities hosted website. Do note that this process uploads changes and not the entire site again. Which means for example if you created a new page but nothing else, only that page will be added not everything else which makes it very efficient.

Step 1 : Install Rustcities-CLI tools

Install the Rustcities package for your distro. It is available for arch via the AUR with the package rustcities-git

paru -S rustcities-git

Use yay or some other AUR helper if you use it instead of paru

Step 2 : Export API Key envvar

export NEOCITIES_API_KEY=xxxxxxxxxxxxxxxx

You can find your unique Neocities API Key from your Neocities Setting. Also be aware that anyone can upload anything as long as they have the API Key to your Website.

Step 3 : Pushing a folder

cd to the folder containing the website files that you need to upload. Then use the push command provided by rustcities-cli

cd /home/username/path/to/website

rustcities push .

Important Note: Do not forget the “.” in the above command. The syntax is rustcities push foldername. Only here the “.” means current directory.

Bonus Step : For hugo generated sites

If you use hugo static site generator like me,

  1. Generate your site by running the hugo command on your website folder (ie, the folder containing the config.toml file and other folders)

  2. Your site will now be generated onto the public folder inside your website folder.

  3. Push the public folder to Neocities by using the command rustcities push ./public