2

I am not sure what's going on, but my personal site - built with Jekyll and hosted on Github pages - has been exhibiting odd css styles behavior as of the last few weeks or so.

I originally set it up on Jekyll 1.something-or-other. I am aware that it is at 3.something now and for the longest time, through 2 etc. I have not had a problem with the styles, everthing was fine up until less than a month ago.

I have not made any changes to the styles configuration for a couple years, but now it is only rendering the styles for the pages (Homepage, About Page, list pages for archives, etc.). But on the actual posts, it drops all the styles - looks like raw markdown and images and no layout.

I have updated jekyll to 3.1.2 on my local machine, and what's even stranger is that when I run it locally, it builds fine and all, but the problem is the opposite. That is, all the posts are formatted with the appropriate styles, but the pages (again - Homepage, about page, archive list) are unstyled.

Again, no changes in any configurations. Is there some obvious places I should be looking? I am using the jekyll bootstrap theme that's a little customized. but not much.

Site is http://subtxt.in

4

1 回答 1

1

我找到了你的回购并四处寻找。那里发生了很多事情,似乎过于复杂。

使用 Chromes 开发工具,您可以看到问题在于 css 加载 - 在好的页面上,正确的路径是:<link href="/assets/themes/the-minimum/css/style.css" rel="stylesheet" media="all">

在它不起作用的帖子上是:<link href="/assets/themes//css/style.css" rel="stylesheet" media="all">

注意缺少的主题名称 - the-minimum。

在您的回购中,我无法弄清楚逻辑,但我认为您可以简化它。这个文件 -_includes/themes/the-minimum/default.html我相信包含所有页面的标题部分。

<link href='{{ ASSET_PATH }}/css/style.css' rel="stylesheet" media="all">认为是问题所在,`ASSET_PATH 似乎返回了不同的值。尝试将其硬编码为正确的路径,例如:

<link href="/assets/themes/the-minimum/css/style.css" rel="stylesheet" media="all">

我不是 100% 肯定这会解决它,但我认为它会。

如果这不能为您解决问题,我会添加一个指向您的存储库的链接,以便其他人可以检查它。

于 2016-03-03T07:45:03.100 回答