At first, I created a simple API via Python that was basically mimicking the localStorage API. It would accept getItem and setItem requests and write it to a file. In the HTML file I was replacing localstorage calls to calls to the API automatically, via a script that was doing a simple search-and-replace on the file. I was also assigning a custom subdomains via nginx to each html file, so that it could have the max 10MB storage that localstorage can have.
After a while it became clunky doing things with separate scripts, so I ended up creating - htmlsync.io. It's still pre-alpha, but registrations for the free tier are open.