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

问题描述

我正在尝试使用 GitHub 页面来托管 Doxygen 站点.理想情况下,我希望能够将生成的文件和目录推送到 GitHub,而无需对其进行任何调整.

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.

然而,这意味着我的 index.html 位于存储库的子文件夹中,而 GitHub Pages 没有选择它(当我尝试访问 Pages 站点时收到 404).有没有办法让 GitHub 在子文件夹中识别 index.html?

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 a way to make GitHub recognise that index.html when it's in a subfolder?

这是一个项目站点.

推荐答案

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

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

<meta http-equiv="refresh" content="0; url=https://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 放在存储库的子文件夹中吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-19 01:10