如何从Jekyll插件中调用

如何从Jekyll插件中调用

本文介绍了如何从Jekyll插件中调用"handleize"液体过滤器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我今天必须离开比赛,因为我什至看不到handleize过滤器的定义位置.它位于 Shopify文档中,当我在我的模板中使用它.但是,我看不到它的源代码,因此无法找到如何从插件中调用它的方法.

I must be off my game today because I can't even see where the handleize filter is even defined. It's in the Shopify documentation, and it works when I use it in my templates. However I can't see the source code for it, so I can't find out how to call it from my plugin.

还要注意,虽然这些 问题相似,由于此处提到的两个源模块中均未定义handleize,因此此处的答案不适用.

Also note that while these two questions are similar, the answers do not apply here because handleize is not defined in either of the source modules mentioned.

如果有关系,我使用的是Jekyll 2.1.1和Liquid 2.6.1.

If it matters, I'm using Jekyll 2.1.1 and Liquid 2.6.1.

推荐答案

OK证明Shopify文档不正确.在Jekyll的标准安装中,某些记录的过滤器(包括handleize)不可用. Jekyll核心团队已意识到文档问题,并正在努力解决这些问题.

OK turns out that the Shopify documentation is not correct; some of the documented filters, including handleize are not available from within a standard Jekyll install. The Jekyll core team is aware of the documentation issues and is working towards fixing them.

还请注意,使用未知过滤器时,液体似乎不会标记任何错误或警告.因此,您可能(就像我一样)认为过滤器有效",而实际上却被默默地忽略了.

Also note that liquid does not seem to flag any errors or warnings when using an unknown filter. Hence you may (as I did) think that the filter "works" when in fact it is silently being ignored.

这篇关于如何从Jekyll插件中调用"handleize"液体过滤器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 17:29