我可以将 GitHub Pages index.html 放在存储库的子文件夹中吗?

编程入门 行业动态 更新时间:2024-10-27 20:29:05
本文介绍了我可以将 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=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 放在存储库的子文件夹中吗?

本文发布于:2023-11-14 16:46:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1587995.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:放在   文件   夹中   Pages   GitHub

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!