Closed bsuttor closed 4 years ago
So, yes. Empty site does not work unless schemata expected by the project is somehow delivered. Exporting and importing a schema only become possible a few months ago and this starter has not been updated to include schemata.
Thank you, In deed, I add this code on the end of gatsby-node.js file:
const fs = require('fs')
const PLONE_SCHEMA = 'plone-typedefs.graphql'
exports.createSchemaCustomization = ({ actions }) => {
if (fs.existsSync(PLONE_SCHEMA)) {
actions.createTypes(fs.readFileSync(PLONE_SCHEMA, { encoding: 'utf-8' }));
} else {
actions.printTypeDefinitions({
path: PLONE_SCHEMA,
include: { plugins: ['gatsby-source-plone'] },
});
}
};
After I make gastby develop
with https://plonedemo.kitconcept.com/en as baseUrl value (on gastby-config.js file) and finally I can use localhost as baseUrl and start gastby develop
one last time.
@bsuttor Awesome. If you had a change and would be able to contribute that (and the required version upgrades) into this project it would be even more awesome.
I was looking to make a PR but I saw you already added plone-typedefs.graphql
file and some other update. Thank you ! It works fine now with empty website.
I try to add mosaic view (customContentLayout
) of a Document now, but I'm not sure what the best way to do that
You may need to delete typedefs to let them be updated with layout attributes. Unfortunately, the layout is in HTML, so not easily usable. If you would really like to use it, you might need to implement new mosaic-expansion for plone.restapi that e.g. could include HTML for rendered tiles and maybe the layout in JSON (could be done by parsing it with lxml).
I don’t have mosaic support in my timeline currently. Before that I need to try out how Volto layouts and tiles could work (they expose configuration in JSON and would require Volto React-components or their reimplementations for actual rendering).
Hi,
I just try this very cool project, but I have some issues when I use a local container instead of plonedemo.kitconcept.com source site.
Here are steps to reproduce:
First I start à local plone restapi instance with a docker-compose.yml file:
$ docker-compose up -d
After I create a gatsby source as explain in doc
$ gatsby new gatsby-restapi https://github.com/collective/gatsby-starter-plone
Then I set source site to use local plone restapi container
And finaly I start gatsby
$ gatsby develop
And here is trace log with compilations errors
Am I doing something wrong to test gatsby-starter-plone with empty Plone site?