开始使用Gatsby(v2),我想知道在Behance网站上可以看到的最佳处理场景的方法有以下几种:
有没有办法在运行时定义Layout
? 2场景带来完全相同的URL。
感谢您的任何建议。
我认为这是你可以研究的完美例子:https://github.com/gatsbyjs/gatsby/tree/master/examples/gatsbygram
在gatsby-browser.js
它设置了这个功能:
exports.onInitialClientRender = () => {
window.___GATSBYGRAM_INITIAL_RENDER_COMPLETE = true
}
https://www.gatsbyjs.org/docs/browser-apis/#onInitialClientRender
然后在src/templates/post-page.js
中设置isModal
,具体取决于您在问题中描述的内容。