Ruby GitHub Jekyll找不到帖子
我在index2.md中有一个降价页面,如下所示:Ruby GitHub Jekyll找不到帖子,ruby,github,markdown,jekyll,Ruby,Github,Markdown,Jekyll,我在index2.md中有一个降价页面,如下所示: --- layout: plain title: Index2 --- test Index2 <ul class="posts"> {% for post in site.posts %} <li><span>{{ post.date | date_to_string }}</span> » <a href="{{ post.url }}"&g
---
layout: plain
title: Index2
---
test Index2
<ul class="posts">
{% for post in site.posts %}
<li><span>{{ post.date | date_to_string }}</span> » <a href="{{ post.url }}">{{ post.title }}</a></li>
{% endfor %}
</ul>
---
布局:普通
标题:Index2
---
测试指标2
{site.posts%中的post为%s}
- {{post.date | date_to_string}}»李>
{%endfor%}
但是,这无法显示我的博客帖子
<body>
<div class="wrapper">
<header>
<h1>Nodeclipse.github.io</h1>
<p>Resource for Nodeclipse developers</p>
<p class="view"><a href="https://github.com/Nodeclipse">View My GitHub Profile</a></p>
</header>
<section>
<div>
<p>test Index2</p>
<p> <ul class="posts"></p>
<p> </ul></p>
</div>
</section>
<footer>
<p><small>Hosted on GitHub Pages — Theme by <a href="https://github.com/orderedlist">orderedlist</a></small></p>
</footer>
</div>
<script src="javascripts/scale.fix.js"></script>
</body>
Nodeclipse.github.io
面向Eclipse开发人员的资源
测试指标2
托管在GitHub页面上&mdash;主题由
这就是博客列表是空的。Markdown将缩进的HTML解释为内容,并为您将其包装在一个
标记中
Markdown将通过raw传递HTML,这是您想要的,但前提是起始标记和结束标记完全没有缩进。因此,取消缩进开头和结尾的
和
标记,标记将使整个HTML块不受干扰。所以它应该是这样的:
test Index2
<ul class="posts">
{% for post in site.posts %}
<li>
<span>{{ post.date | date_to_string }}</span>
»
<a href="{{ post.url }}">{{ post.title }}</a>
</li>
{% endfor %}
</ul>
testindex2
{site.posts%中的post为%s}
-
{{post.date | date_to_string}
&拉阔;
{%endfor%}
您的问题似乎是您的ul
块被解释为文本。您是否正在使用index2.md
中的选项卡?如果是这样,请尝试将选项卡转换为空格。是的。然而,帖子仍然丢失请查看来源,因为我已经更正了缩进。我查看了您的回复,似乎您的\u posts
目录有一个前导空格,这意味着Jekyll找不到它。运行mv\\u posts\u posts
来修复它,最后享受Jekyll:)是的,这正是问题所在。