Is there any danger to expose grav config in a javascript object for frontend parametrisation ?
I do this in a plugin
public functionn onPluginsInitialized() {
//map plugin config
$configJSON = json_encode($this->grav['config']);
$assets->addInlineJs("var GRAV = {};GRAV.config = JSON.parse('" . addslashes($configJSON) . "');", ['loading'=>'inline', 'position'=>'before']);.
}
I need to get page frontmatter configuration as well, in order to work with more advanced javascript.
If there is any other proper way to achieve this, I woul dbe happy to know it.
More generally is there any form of way of working with a assets vue.js or any mordern js framework in themes or plugins ?
That would be a great point to deal with in documentation, in order to get more developpers in grav cms !!
Thanks in advance