gh-pages:缺少一些页面 (404)

gh-pages : some pages missing (404)

我正在尝试设置 github 站点:https://github.com/derlin/semantic-modals/tree/gh-pages。我使用 ng-include 指令,例如:

<div ng-include src="'_main.html'">

在不同的地方,但其中 none 有效。

我试图重命名我的文件,将它们从 html 文件夹移动到根目录,我总是以 404 结束。

我可以在浏览器中显示我的任何文件,例如:http://derlin.github.io/semantic-modals/vendor/semantic/semantic.min.css, but http://derlin.github.io/semantic-modals/_main.html or http://derlin.github.io/semantic-modals/_editModalContent.html 系统性失败(甚至在 move/rename 之后)。

为什么 github.io 的这些文件 "invisible" 而存在于我的 repo 的 gh-pages 分支中?

您使用 ng-include 的方式有误。参见 documentation,有两种方式(标记和属性),您将它们混合使用。

<ng-include
  src="string"
  [onload="string"]
  [autoscroll="string"]>
...
</ng-include>

<ANY
  ng-include="string"
  [onload="string"]
  [autoscroll="string"]>
...
</ANY>

您可以使用

<div ng-include="_main.html">

<ng-include src="_main.html">

但不要混用。

并查看 GitHub 文档中的 this page。您需要重命名文件或进行一些操作才能发布名称以下划线开头的文件。默认情况下它们是隐藏的。

GH 页面假设您的分支是来自 docs

的 jekyll 构建的输出

By default, Jekyll does not build any files or directories that

  • contain site content (indicated by names that start with _); or are excluded in the site configuration.

解决方法是在根路径中创建一个名为 .nojekyll 的文件以关闭 Jekyll