github页面脚本仅在自定义域上不加载

时间:2020-08-04 22:20:50

标签: gatsby github-pages

我的网站(由 Gatsby 开发)托管在github页面上,并且可以正常运行。但是,如果我尝试使用自定义域,则不会加载某些脚本。我试图使用相同的github存储库在netlify中部署站点,并且脚本也不会加载。

我的github网站:https://rodrigorochadev.github.io/pathfinderdesigns

Netlify网站:https://quirky-jones-2ae5a3.netlify.app/

有什么提示吗?

1 个答案:

答案 0 :(得分:1)

我找到了解决方案。在data: function() { return { contacts: [this.initContact()], showThanks: false, emailError: false, blankEmail: false, blankName: false } }, methods: { initContact: function() { return { name: null, email: null, title: null, validDetails: this.initValidDetails(), valid: true, } }, initValidDetails: function() { return { emailDomain: true, emailExists: true, emailFormat: true, name: true } } } 中,我的gatsby-config.js被设置为我的仓库名称。我已将其更改为pathPrefix,并且现在可以在Netlify上使用。