Hi,
I enjoy feeding initial data for javascript client scripts into the page at render time, rather than make further HTTP requests for data.
(I've used this approach quite satisfactorily on Thymelaf etc)
Here is a Gist which shows how i've implemented this in Pebble.
It works fine, and I can output arbitrary JSON data.
Notice I must use...
...to get plain JSON data.
Is there a better way?
Thanks
Rob
PS, You may notice I'm using a custom syntax to avoid handlebars {{}} on the servside, as I use handlebars/angular on the client side.