在Jekyll中,是否有一个简洁的方式来呈现Markdown偏好?

我有一个Markdown格式的边栏,我想在我的Jekyll博客中显示。 我以前试图把它包括像{% include sidebar.markdown %}但它不会实际渲染降价。 我可以成功地将其包含

 {% capture sidebar %}{% include sidebar.markdown %}{% endcapture %} {{ sidebar | markdownify }} 

尽pipe这是一个可pipe理的解决scheme,但我更喜欢用更加优雅的方式来完成这个任务。 有任何想法吗? 提前致谢!

Jekyll现在支持编写简单的插件来添加标签,转换器或者生成器。 有关详细信息,请参阅http://jekyllrb.com/docs/plugins/

我也在寻找这个,这是PITA发现如何做到这一点,没有太多的Google内容,最准确的发现是一个不能在这里工作的要点…死简单的解决scheme:

./_plugins/markdown_tag.rb

 module Jekyll class MarkdownTag < Liquid::Tag def initialize(tag_name, text, tokens) super @text = text.strip end require "kramdown" def render(context) tmpl = File.read File.join Dir.pwd, "_includes", @text Jekyll::Converters::Markdown::KramdownParser.new(Jekyll.configuration()).convert(tmpl) end end end Liquid::Template.register_tag('markdown', Jekyll::MarkdownTag) 

更新:使用示例的博客: http : //wolfslittlestore.be/2013/10/rendering-markdown-in-jekyll/