gpt4 book ai didi

ruby - 在 Jekyll 页面中使用 Liquid 标签不起作用

转载 作者:IT王子 更新时间:2023-10-29 00:35:46 31 4
gpt4 key购买 nike

我正在尝试使用 Jekyll 建立一个小型博客。到目前为止,我的工作如下。

  • 设置 Github 页面存储库
  • 在本地克隆 repo
  • 安装了 Ruby vs 2 和 sdk (windows)
  • 已安装 jekyll
  • “服务”本地网站。
  • 验证我可以查看我的网站 localhost:4000

一切正常,但流式语法未按预期工作。所有语法都输出为平面文本。我不确定如何继续。这个错误既发生在本地,也发生在我的 github 托管页面上。

这是我的 index.html 文件

<!DOCTYPE html>
<html lang="en-us">
<head>
{% include meta %}{{ site.time | date_to_xmlschema }}
</head>
<body>
{% include header.html %}
{% include header.html %}
{% include header.html %}
{% foo %}
{{ foo }}

<section class="main-content">
{% include footer.html %}
</section>
{% include scripts.html %}
</body>
</html>

我的 _config.yml 定义了 foo。 =(

最佳答案

如果您希望 Jekyll 处理您的页面,您必须在页面中添加一个 Front matter ( see dedicated page in Jekyll documentation)。

最小的front matter是一个空的。这意味着您的页面将使用默认配置进行布局等。

---
# this is an empty front matter
---
Your content here

关于ruby - 在 Jekyll 页面中使用 Liquid 标签不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29662793/

31 4 0