Fixing "Publii cannot find your sites folder".

I'm using Pulbii for this site and MrsVark's Wheely Happy Days site.

So that I can use it on multiple devices, I have the "sites folder" saved in my OneDrive account.

A Windows file explorer window showing a folder path. The directory path reads 'C:\Users\Paul\OneDrive\Documents\Public\sites'. Bloody typical Windows, a file path more complicated than the London Underground map.

However, every now and then when I fire up Publii on a different device to the one I've most recently been using, I get an error message before the app fires up.

Windows error message with a red circular icon showing an X. The message reads: 'Publi cannot find your sites folder. Please check if the directory C:\Users\peeps\OneDrive\Documents\Public\sites exists or create it manually, then reopen the application.' Typical Microsoft - always assuming I remember where I put things. As if I can find anything on my computer after a few pints.

This prevents you opening Publii and you can't, therefore, change the setting in app.

I did a quick Qwant search but all of the suggested solution involved changing the location of the Files folder to match the one in the error message then moving it back using the app. And, bejeebus that'd be a faff.

The easier answer is to edit the "app-config.json" file. For my installation on my main PC, this is installed on my OneDrive documents folder. Your mileage may vary, but I guess you're looking for "Publii/config".

Screenshot of a Windows File Explorer window showing the contents of a 'config' folder. The navigation path reads 'This PC > Documents > Publi > config'. Two JSON configuration files are displayed: 'app-config.json' and 'window-config.json', both with green checkmarks indicating they're synchronized. About as exciting as watching paint dry, but at least my files are properly sorted for once.

 

Inside that file, you can edit the "sitesLocation" directly.

Snippet of a JSON configuration file with various settings. The code shows configuration parameters including 'openDevToolsInPreview' set to false, 'resizeEngine' set to 'sharp', and a file path pointing to 'C:\Users\Paul\OneDrive\Documents\Publi\sites'. Other settings include time format set to '24h' and 'closeEditorOnSave' set to true. Reminds me of when I try to assemble IKEA furniture—technical instructions that make perfect sense to someone, but certainly not to me.

This has happened to me several times, and each time I've had to search for the solution. But this time, I couldn't find it online and had to dumbly blunder around in the various program files and folders online in order to find the solution. So I'm posting it here as much for my own purposes as for anyone else.