【发布时间】:2019-11-20 20:30:06
【问题描述】:
我有一个使用 Github 页面托管的 React 应用程序。最初,按照此处编写的步骤进行操作:https://medium.com/@hossainkhan/using-custom-domain-for-github-pages-86b303d3918a 我只能看到一个空白页。在查看了其他 S/O 问题后,我意识到我必须编辑 index.html 文件,如本文所述:hosting gh-pages on custom domain, white empty page 这行得通,该网站现已启动:
https://www.mohaiminalaoun.com
但是,我也有一些未渲染的 svg 图像。
我的 index.html 文件:https://github.com/mohaiminalaoun/mohaimin/blob/gh-pages/index.html
控制台中的错误是:GET https://mohaiminalaoun.com/mohaimin/static/media/face.01df9ea9.svg 404 这是有道理的,因为那不应该是路径。
在 index.html 文件中,我尝试将路径从“/mohaimin/face.svg”更改为“/face.svg”,然后再次更改为“/static/media/face.svg”,然后甚至尝试直接给出href:https://mohaiminalaoun.com/static/media/face.01df9ea9.svg,但没有一个他们在部署的页面上工作。
我不确定如何/是否应该再次编辑 index.html 文件以修复 svg 图像。
更新:在已发布的域中,/static/js/face.svg 中的 svg 文件只有一行 module.exports = __webpack_public_path__ + "static/media/face.01df9ea9.svg"; 我猜这需要以某种方式进行更改,但还不知道怎么做。
【问题讨论】:
标签: reactjs github-pages google-domains