-
-
Notifications
You must be signed in to change notification settings - Fork 557
Description
I've been experimenting with taking some of the templating and state management that 11ty provides and moving it into a service worker.
As part of that process, the service worker needs access to data (i.e. HTML-formatted content) and metadata (e.g. titles, dates, tags, other post-specific state info, along with global config that lives under _data/) as well as the underlying templates used to render the final HTML.
It's possible to collect a good deal of this required info at build time and format it so that it could be cached by the service worker and used later on. (Here's an example of how I'm doing that, and @zachleat offered some suggestions on Twitter for improving that process for post-specific [meta]data.)
One of the thing I'm not sure how to do is to get at 11ty's internal data about collections, which would need to be dumped at build time, and read by the service worker at runtime, in order to have the service worker render index.html-style templates, or deal with pagination. It would be great to see either documentation as to how to get at that data, or for a new helper function to be created to make it easy to dump out all of the internal state that might be useful for this purpose.
(In the course of researching this issue I found #130, which is tangentially related.)