css - Jekyll github pages 站点忽略 .css

标签 css git github jekyll

这在某一时刻奏效了。但是,我将元素保留在我认为可以正常工作的状态,然后回来发现格式全部损坏。 repo 可用here网站托管 here.

我检查了我的 _layouts/文件夹,它有 /似乎根据答案正确设置 here.

同样,我设置了我的基本 URL,因为这是一个符合 this question. 的元素页面

当我推送 RMD 文件时可能出了点问题,但是我试图回退并推送它作为 repo 的版本,但我没有看到任何变化(也许我做得不好,我'我是 github 的新手,也是 git 的新手)。

我怎样才能恢复格式?原始结构是使用本教程在 jekyll and ghpages. 上制作的

最终解决方案:

在检查和测试了 LarsW 和 David_Jacquel 的答案后,最终修复如下:

  1. _config.yml - 包含baseurl: /Pokemon_FieldStudies
  2. default.html - 包含 <link rel="stylesheet" type="text/css" href="{{ site.baseurl }}/css/main.css">

最佳答案

链接有误。 /css/main.css 中的第一个 / 使其转到根文件夹,这是域 ( http://davergp.github.io/ ) 而不是站点 ( http://davergp.github.io/Pokemon_FieldStudies/ ) .只需将其更改为 /Pokemon_FieldStudies/css/main.csscss/main.css

关于css - Jekyll github pages 站点忽略 .css,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36531543/

相关文章:

javascript - jquery addClass 不适用于表单元素

git - git 服务器在哪里存储推送的文件以及在客户端克隆时从哪里获取?

angularjs - 致命的 : in unpopulated submodule

git - GitHub 中的 Fork 和 Pull 模型是什么?

html - CSS 菜单不适用于平板电脑

javascript - 阻止 float 标签重置回原始位置

html - 显示图标按钮的子菜单

从 SourceAnywhere 导入 Git/GitHub

git - 将多个 git repos check out 到同一个 Jenkins 工作区

angular - 如何在 Angular 项目中使用 HttpHeaders Link 进行分页?