Closed benjgrad closed 2 years ago
I'd suggest you export the project data JSON in order to be able to reimport the project easily.
root: {
// ...
'project.json': (editor) => JSON.stringify(editor.getProjectData()),
}
Thanks. I created a basic storage server/db, and I'm using it to hold the json data.
I think there are genuine use cases for preserving the data-gjs-type attributes in the html though... Below, I linked an issue ticket where people are editing the html in a modal, and the attributes are being deleted.
https://github.com/artf/grapesjs/issues/324
If you're looking for a demo, you can use https://editor.gradyserver.com/issue (I know the load time sucks, but it's just a static html file, so you can see all of the code.)
Edit: Created a feature request (in grapesjs instead of grapesjs-plugin-export), with code to PR.
I recently tried exporting the html and css of my sample site to load it back into grapesjs as the index.html. (I'm making a custom plugin and wanted to make a site to demo it.) After some troubleshooting, it seems like the components won't register without including the data-gjs-type.
Is it possible to configure the export so the generated html includes these data-gjs-type attributes?
Thanks in advance.