在自定义域上托管gh页,空白页 [英] hosting gh-pages on custom domain, white empty page
问题描述
编码新手,需要一些帮助. 我创建了一个React项目(使用create-react-app),并且该网站已经在我的gh-pages分支上运行
(这里是我的仓库: https://github.com/simchaleh/shivisihashem.git)
我一直试图将gh-pages项目托管在自定义域中. 当它托管在gh页上时,我的react项目看起来很棒,但是当我尝试将其连接到我的自定义域时,我得到的只是一个纯白色的屏幕.这是我在自定义域上的dns设置的屏幕图片. (您还可以看到gh-pages表示其在我的域中托管): DNS设置和gh页/设置页
我在gh-pages分支中有一个CNAME文件,只有一行,我在其中放置: shivisihashem.com
有人知道为什么我的自定义域上只有空白的白屏吗?
谢谢!
我刚刚从github员工那里得到了答案.它解决了我的问题. 如果其他人也遇到同样的问题,请回答以下问题:
您需要编辑的文件在这里:
https://github.com/simchaleh/shivisihashem/blob /gh-pages/index.html
当前,这两个部分有错误:
<script type="text/javascript"
> src="/ShivisiHashem/static/js/main.7cdb5ccf.js"></script>
>
> <link href="/ShivisiHashem/static/css/main.ff643f95.css"
> rel="stylesheet">
您应该可以通过将其替换为这些问题来解决该问题:
<script type="text/javascript"
> src="/static/js/main.7cdb5ccf.js"></script>
>
> <link href="/static/css/main.ff643f95.css" rel="stylesheet">
我希望能对您有所帮助!让我们知道您是否还有其他问题.
im new to coding and need some help. I made a react project (using create-react-app), and the website has been running on my gh-pages branch
(heres my repo: https://github.com/simchaleh/shivisihashem.git)
ive been trying to host the gh-pages project on a custom domain instead. my react project looks great when its hosted on gh-pages, but when i try to connect it to my custom domain, all i get is a solid white screen.
heres a screen pic of my dns settings on custom domain. (u can also see that gh-pages says its hosting on my domain): dns settings and gh-pages/settings page
I have a CNAME file in gh-pages branch, with one line, where i put: shivisihashem.com
does anyone have any ideas why im just getting a blank white screen on my custom domain?
thanks!
i just got an answer from github staff. it solved my issue. heres the answer if anyone else has this same issue:
The file you need to edit is here:
https://github.com/simchaleh/shivisihashem/blob/gh-pages/index.html
Currently, these two sections have errors:
<script type="text/javascript"
> src="/ShivisiHashem/static/js/main.7cdb5ccf.js"></script>
>
> <link href="/ShivisiHashem/static/css/main.ff643f95.css"
> rel="stylesheet">
You should be able to resolve the issue by replacing them with these:
<script type="text/javascript"
> src="/static/js/main.7cdb5ccf.js"></script>
>
> <link href="/static/css/main.ff643f95.css" rel="stylesheet">
I hope that helps! Let us know if you have any other issues.
这篇关于在自定义域上托管gh页,空白页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!