From 3e76d6565603fafa2c85ad81d7b6345c4e279c72 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sun, 28 May 2017 22:50:57 -0700 Subject: Rearrange all the docs to allow for a docs/major.minor/ setup --- _plugins/markdown-block.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 _plugins/markdown-block.rb (limited to '_plugins/markdown-block.rb') diff --git a/_plugins/markdown-block.rb b/_plugins/markdown-block.rb new file mode 100644 index 000000000..f9f1531b5 --- /dev/null +++ b/_plugins/markdown-block.rb @@ -0,0 +1,20 @@ +module Jekyll + class MarkdownBlock < Liquid::Block + alias_method :render_block, :render + + def initialize(tag_name, markup, tokens) + super + end + + # Uses the default Jekyll markdown parser to + # parse the contents of this block + # + def render(context) + site = context.registers[:site] + converter = site.find_converter_instance(::Jekyll::Converters::Markdown) + converter.convert(render_block(context)) + end + end +end + +Liquid::Template.register_tag('markdown', Jekyll::MarkdownBlock) -- cgit v1.2.3