I'm using posthtml with modules to structure a static website, and I thought it would be useful if we could specify a path to a JSON file for the locals attribute, instead of including the data object directly in the template. It would make it easier to reference the same data in multiple places if you want to use different templates with the same information.
@jazael0 Hello, the idea is interesting, but I think you still unload the data beforehand by passing it as options, and you can reuse it anywhere in the same way.
Perhaps it will suit you if you need to use different scopes in different parts of the component.
Hi,
I'm using posthtml with modules to structure a static website, and I thought it would be useful if we could specify a path to a JSON file for the locals attribute, instead of including the data object directly in the template. It would make it easier to reference the same data in multiple places if you want to use different templates with the same information.
E.g. locals="/data/my-page-data.json"
Is this something that is easily achieved?
Regards, Rob.