我可以在存储库的子文件夹中拥有我的Github Pages index.html吗? [英] Can I have my Github Pages index.html in a subfolder of the repository?

查看:143
本文介绍了我可以在存储库的子文件夹中拥有我的Github Pages index.html吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用Github页面来托管一个Doxygen网站。理想情况下,我希望能够将生成的文件和目录推送到Github,而不必调整它们。但是,这意味着我的index.html位于存储库的子文件夹中,而Github Pages没有选择它(当我尝试访问Pages网站时,我得到了404)。有什么办法让Github在子文件夹中识别index.html?它是一个项目网站。

I'm trying to use Github pages to host a Doxygen site. Ideally, I'd like to be able to push the generated files and directories to Github without having to tweak them at all. This, however, means that my index.html is in a subfolder of the repository and Github Pages isn't picking it up (I get a 404 when I try to access the Pages site). Is there any way to make Github recognise that index.html when it's in a subfolder? It is a project site.

推荐答案

在根目录下创建一个虚拟index.html并将其放入您的标题中:

Create a dummy index.html at the root and put this in your header :

<meta http-equiv="refresh" content="0; url=http://repo.github.io/folder/index.html" />

请务必更改目标网址。这会立即从index.html重定向到您的文件夹/ index.html。

Be sure to change the destination url. This will instantly redirect from index.html to your folder/index.html.

这篇关于我可以在存储库的子文件夹中拥有我的Github Pages index.html吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆