Ruby 杰基尔不会解释降价
我正在使用创建网站。Ruby 杰基尔不会解释降价,ruby,web,markdown,jekyll,jekyll-extensions,Ruby,Web,Markdown,Jekyll,Jekyll Extensions,我正在使用创建网站。 我有一个名为about.html的页面: <div class="grid_10 page"> {% include about_content.markdown %} </div> 由于某些原因,呈现页面时,结果如下: 即使我将YAML前端内容添加到我的降价文件中,也不会有任何更改 这是我的_config.yml safe: false auto: false server: false serve
我有一个名为about.html的页面:
<div class="grid_10 page">
{% include about_content.markdown %}
</div>
由于某些原因,呈现页面时,结果如下:
即使我将YAML前端内容添加到我的降价文件中,也不会有任何更改
这是我的_config.yml
safe: false
auto: false
server: false
server_port: 4000
baseurl: /
source: .
destination: ./_site
plugins: ./_plugins
future: true
lsi: false
pygments: false
markdown: maruku
permalink: date
maruku:
use_tex: false
use_divs: false
png_engine: blahtex
png_dir: images/latex
png_url: /images/latex
rdiscount:
extensions: []
kramdown:
auto_ids: true,
footnote_nr: 1
entity_output: as_char
toc_levels: 1..6
use_coderay: false
coderay:
coderay_wrap: div
coderay_line_numbers: inline
coderay_line_numbers_start: 1
coderay_tab_width: 4
coderay_bold_every: 10
coderay_css: style
如何让jekyll解释markdown?您必须通过
markdownify
过滤器:
<div class="grid_10 page">
{% capture about_content %}
{% include about_content.markdown %}
{% endcapture %}
{{ about_content | unindent | markdownify }}
</div>
谢谢,这个解决方案奏效了,但我遇到了一个问题,在
{%include about_content.markdown%}
前面加空格会使第一行标记无效。在不牺牲缩进的情况下可以避免这种情况吗?应该注意的是,这(以及所有插件)不适用于GitHub页面。我花了一段时间才弄明白这一点,似乎除了去掉include行(看起来很奇怪)或在没有源文件的情况下推送编译过的页面(毫无意义)之外,没有其他好的解决方案。[
<div class="grid_10 page">
{% capture about_content %}
{% include about_content.markdown %}
{% endcapture %}
{{ about_content | unindent | markdownify }}
</div>
module Jekyll
module UnindentFilter
def unindent input
input.lstrip
end
end
end
Liquid::Template.register_filter Jekyll::UnindentFilter