我正在使用Gatsby主题博客。我将其安装在新站点as documented here中,一切正常。我想更改主要职位索引的查询。我在主题的gatsby-node中看到了它。如何在我的网站中覆盖它?
答案 0 :(得分:1)
您需要使用shadowing来替换<strong>
文件。这意味着您将放置与主题gatsby-node.js文件的路径相对应的自己的gatsby-node.js文件。
从文档中:gatsby-node.js
Until we build tooling to support automatically handling shadowing, you will have to manually locate paths in a theme and create the correct shadowing paths in your site.
是Gatsby构建过程中的特殊文件。我不知道是否可以像这样“替换”。如果它不能像文档中所描述的那样容易,我建议删除主题中的主要文章索引查询,并用您自己的主题替换。