我正在使用Maven插件(jacoco-maven-plugin)生成一个站点报告,其图像和css文件位于前面的文件夹中。 (点)在名称中。例如:/site/jacoco/.resources/report.css
当我将它发布到我的pages.github.com网站(使用site-maven-plugin)时,我的特殊Github分支(gh-pages)中的所有内容都已存在。
但是,当我尝试访问具有前一个文件夹的资源时,我得到了404。 (点)文件夹名称。
简化示例:
https://github.com/justinhrobbins/FlashCards_App/blob/gh-pages/test/.resources/index.html
当我尝试在浏览器中访问它时,我得到404:
http://justinhrobbins.github.io/FlashCards_App/test/.resources/index.html
但是,如果我删除了。 (点)文件夹名称工作正常:
https://github.com/justinhrobbins/FlashCards_App/blob/gh-pages/test/resources/index.html
http://justinhrobbins.github.io/FlashCards_App/test/resources/index.html
所以我假设pages.github.com不支持文件夹名称中的前面的点(并且使用前面的点的谷歌搜索显示可能不是推荐的做法)但是会感谢您的确认。
编辑:仅供参考 - 当我发布类似于Tomcat时,它甚至可以使用名称前面带有点的文件夹
答案 0 :(得分:7)
我认为这与pages.github.com对Jekyll的支持有关。
我现在能够使用page.github.com处理包含前一个点(。)的目录名称
解决方法是在我的gh-pages分支的根目录中添加.nojekyll文件。
以下资源帮助我解决了这个问题:
答案 1 :(得分:0)
As mentioned here 你也可以用 Jekyll 本身来配置它。通过将文件/目录添加到根目录中的 _config.yml
来将它们列入白名单。
include:
- .my-hidden-folder