根中的博客循环破坏了格式/解析 - jekyll 站点

发布于 2025-01-08 18:07:53 字数 884 浏览 3 评论 0原文

我制作了一个 jekyll 网站,一切都很好。然后我决定将博客移至域的根目录。现在看来 jekyll 无法正确解析我的帖子。帖子内容中的所有格式均被删除。标题、突出显示和所有内容都只是作为字符串输出。我的布局文件中的 Html 标签完好无损,其他一切都按预期工作。

这是我的 index.html,它呈现博客循环:

---
layout: main
title: my title
---
{% for post in site.posts %}
<article>
    <h3><a href="{{ post.url }}">{{ post.title }}</a></h3>
<time datetime="{{ post.date | date: "%Y-%m-%d" }}"><span>{{ post.date |     date_to_string }}</span></time>
{{ post.content | postmorefilter: post.url, "Read the rest of this entry" }}
</article>
{% endfor %}

这是我的帖子的布局 (journal.html):

---
layout: main
---

<article>
    <h2>{{page.title}}</h2>
    {{ page.content }}
</article>

我的帖子使用 layout:journal

我已经删除了生成的站点,停止并启动了 jekyll以及许多其他的事情。

有什么建议吗?

I've made a jekyll site, and all was fine and dandy. Then I decided to move the blog to the root of the domain. Now it looks like jekyll doesn't parse my posts correctly. All formatting is stripped from the post content. Headers, highlighting and everything is just output as a string. Html tags from my layout files are intact, and everything else is working as expected.

This is my index.html which renders the blog loop:

---
layout: main
title: my title
---
{% for post in site.posts %}
<article>
    <h3><a href="{{ post.url }}">{{ post.title }}</a></h3>
<time datetime="{{ post.date | date: "%Y-%m-%d" }}"><span>{{ post.date |     date_to_string }}</span></time>
{{ post.content | postmorefilter: post.url, "Read the rest of this entry" }}
</article>
{% endfor %}

And this is the layout for my posts (journal.html):

---
layout: main
---

<article>
    <h2>{{page.title}}</h2>
    {{ page.content }}
</article>

My posts uses layout: journal

I have removed the gererated site, stopped and started jekyll and numerous other things.

Any suggestions?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

半窗疏影 2025-01-15 18:07:53

好吧,事实证明,一如既往,这都是我自己的错。

我的日记布局错误。我将 {{ page.content }} 更改为 {{ content }} - 瞧!

Well, turns out it was my own fault as always.

My journal layout was wrong. I changed {{ page.content }} to {{ content }} - ét voila!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文