由于标签未知,与Jekyll构建失败

发布于 2025-02-07 15:58:33 字数 445 浏览 1 评论 0原文

我用Jekyli在GitHub上订立了博客存储库,然后将我的文章推到_POST文件夹。
我将jinja2的宏代码附加到了下面的文章中,

{% macro -%}

但是github动作“构建和部署”失败了,因为构建阶段使

Liquid Exception: Liquid syntax error (line 69): Unknown tag 'macro' in

我试图在“%”之前提出一个例外,而jekyll却构建了成功,

{\% macro -\%}

但是“ \”也显示在

我也试图为其他jekyll存储库提供的文章中显示,这种现象是一样的,所以我认为这是jekyll构建问题,

有人可以帮助我吗?非常感谢您的建议

I fork a blog repository on Github with JekylI and push my article to the _post folder.
I attached the macro code for Jinja2 to the article as below

{% macro -%}

However the github actions "pages build and deployment" is failed because of the build stage threw an exception

Liquid Exception: Liquid syntax error (line 69): Unknown tag 'macro' in

I tried to increment "\" before "%" like this and Jekyll build success

{\% macro -\%}

But "\" is also displayed in the article

I also tried to fork other Jekyll repository, the phenomenon is the same, so I think it is jekyll build problem

Can anyone help me? Thank you very much for any advice

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

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

发布评论

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

评论(1

世界等同你 2025-02-14 15:58:34

该问题是代码中的{}由Jekyll标识为液体代码。
添加{%raw%}{%endraw%}告诉jekyll不要将内容视为液体代码

{% raw %}
{% macro -%}
{% endraw %}

The problem is {} in the code are identified by Jekyll as Liquid code.
Add {% raw %} and {% endraw %} to tell Jekyll not to treat the content as Liquid code

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