当使用 /doc作为github页面源时,如何将存储库设置为根



如果我将我的githubpages存储库设置为 <username>.github.io,则根中的任何内容都显示在 <username>.github.io

,但我想使用/docs功能,因此我可以在项目的根部有一个静态站点生成器,该生成器输出到/docs文件夹

所以文档说

- have a /docs folder in the root of the repository
- not follow the repository naming scheme <username>.github.io or <orgname>.github.io

所以,我重命名了我的回购," blah"

但是现在<username>.github.io上没有任何内容显示,页面位于<username>.github.io/blah

因此,当使用/docs时,如何将存储库设置为网站的根<username>.github.io

与GitHub支持联系后,事实证明您无法(当前)您需要使用他们使用<username>.github.io

的其他方法之一

我发现了同样的问题。尝试几个小时后,我发现:

  1. 如果使用名为'.github.io''或'.github.com'的存储库,则只能使用其预先提供的文件结构,这意味着您无法选择GitHub-的源页面服务。

  2. 如果将存储库重命名为与自动服务模式不匹配的其他名称(.github.io | ... com),则可以选择源。

  3. 如果情况[2],您需要添加一个名为'.nojekyll'unever/docs文件夹的空文件,并将所有文件放置在内)。

参考:https://www.docslikecode.com/articles/github-pages-pages-python-sphinx/

最新更新