使用 Jekyll 按类别对帖子进行排序在本地有效但在 Github 页面上无效?
Sorting posts by category using Jekyll works locally but not on Github pages?
我在 Jekyll 中有 post 按类别排序,不会显示在 github 页面上。 post 中的 yaml 字体问题将类别设置为 CSS 和设计但不显示 on the category page,代码如下:
{% for post in site.categories.CSS %}
{% if post.url %}
<a id="h1a" href="{{ post.url }}">{{ post.title }}</a>
<p id="date">{{ post.author }} • {{ post.date | date: "%b %-d, %Y" }}</p>
<div id="excerpt">{{ post.excerpt }} </div>
<div id="readmore"><a href="{{ post.url | prepend: site.baseurl }}">Read More</a></div>
{% endif %}
{% endfor %}
本地有效,URL路径(/css/design/2016/01/10/responsive-web-design-css-viewport.html)显示分类在,但在link上面不显示。 Here is my repository,上面的代码可以在根目录下的css文件夹中找到。
Jekyll 3.x 使用类别 "as is" : CSS 保持 CSS.
Jekyll 2.x 是 down-casing 类别:CSS 变为 css.
因此,在 Github 页上 site.categories.CSS == nil
为了在 Github 页面配置中本地工作,您可以按照 install instructions here.
我在 Jekyll 中有 post 按类别排序,不会显示在 github 页面上。 post 中的 yaml 字体问题将类别设置为 CSS 和设计但不显示 on the category page,代码如下:
{% for post in site.categories.CSS %}
{% if post.url %}
<a id="h1a" href="{{ post.url }}">{{ post.title }}</a>
<p id="date">{{ post.author }} • {{ post.date | date: "%b %-d, %Y" }}</p>
<div id="excerpt">{{ post.excerpt }} </div>
<div id="readmore"><a href="{{ post.url | prepend: site.baseurl }}">Read More</a></div>
{% endif %}
{% endfor %}
本地有效,URL路径(/css/design/2016/01/10/responsive-web-design-css-viewport.html)显示分类在,但在link上面不显示。 Here is my repository,上面的代码可以在根目录下的css文件夹中找到。
Jekyll 3.x 使用类别 "as is" : CSS 保持 CSS.
Jekyll 2.x 是 down-casing 类别:CSS 变为 css.
因此,在 Github 页上 site.categories.CSS == nil
为了在 Github 页面配置中本地工作,您可以按照 install instructions here.