我正在建立一个gatsby网站,使用Kentico作为无头CMS,唯一的问题是,它似乎不可能预览与Gatsby的kentico云内容。
kentico的一个很大的功能是它有内置的工作流程,这对于需要在发布之前获得批准的公司来说是很棒的。将会出现审批者想要在gatsby网站中查看其外观的情况,而不是在批准之前仅查看kentico中的内容。
发布于 2019-03-29 08:25:09
用Kentico CLoud Gatsby source plugin设置预览绝对是可能的。
来自JavaScript SDK configuration object的所有属性都可以传递给Gatsby配置。
因此,configuration for the preview将如下所示:
module.exports = {
...
plugins: [
...
{
resolve: `gatsby-source-kentico-cloud`,
options: {
deliveryClientConfig: { // Configuration object
projectId: `XXX`,
previewApiKey: `YYY`,
enablePreviewMode: true,
typeResolvers: []
},
languageCodenames: [ // example language configuration
`en-US`, // default language
`es-ES`,
]
}
}
...
]
...
}https://stackoverflow.com/questions/55408603
复制相似问题