

























If you want to have a custom _includes directory, and maybe more than one
_includes directory, you can easily achieve this by adding a new tag to your
existing Jekyll tag library:
module Jekyll
module Tags
class SnippetTag < IncludeTag
def resolved_includes_dir(context)
context.registers[:site].in_source_dir('_snippets')
end
end
end
endLiquid::Template.register_tag('snippet', Jekyll::Tags::SnippetTag)
Put this in a file in your _plugins directory, then use it then with
{% snippet test.md %}
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。