In broad strokes there are a couple of approaches that you could take with it
First, mind that frontity does already partly work offline! For example, go to mars.frontity.org, click on the “Nature” tab, switch your wifi off and then click on “Home” (or click the browser’s back button). You’ll notice that the front page still shows up. This is because by default frontity will not try to fetch new data for a post/category/taxonomy, etc. that was already loaded but rather load it from an internal cache. So this data will always be available until a user closes the tab or refreshes the page. But I’m guessing that this is not good enough
Now, if you are looking for something very simple, you could hack it together by saving the content in
localStorage after every fetch. And then checking if the user is online or not with
navigator.onLine and if they are offline, get the content from the localStorage instead. I think this approach is not very scalable though.
If you need something more powerful, we are going to eventually support creating PWAs and adding service workers, but that is still in the planning phase - it would require the ability to extend frontity’s webpack configuration. We are discussing this feature in: Progressive Web App