Skip to content

Latest commit

 

History

History
29 lines (21 loc) · 658 Bytes

tag-with-own-includes-dir-lookup.md

File metadata and controls

29 lines (21 loc) · 658 Bytes
layout title
snippet
Use Your Own Includes Directory Lookup in Your Liquid Tags

{{ page.title }}

Add your own _includes directory lookup to your liquid tags by adding resolved_includes_dir:

module Jekyll
  module Tags
    class SnippetTag < IncludeTag
      def resolved_includes_dir(context)
        context.registers[:site].in_source_dir('_snippets')
      end
    end
  end
end

Liquid::Template.register_tag('snippet', Jekyll::Tags::SnippetTag)

Sources