Jekyll网站上的Markdown无法呈现?

7
Markdown没有被转换成HTML。
_config.yml
# Build settings
markdown: kramdown
    input: GFM
# Permalinks
permalink:        pretty
encoding:         UTF-8

前端输出

<article class="post-content">
<!-- Contents of md files here in plain text-->
</article>
2个回答

6

kramdown语法所述,您需要启用对html-block元素中markdown的解析。有两种方法可以实现:

全局方式:在您的 _config.yml 文件中添加以下内容:

kramdown:  
  parse_block_html: true

或者在您的Markdown文档开头(不要在yaml-header中)设置:

{::options parse_block_html="true" /}

本地环境下,将markdown="1"添加到你的html代码块中,以渲染块内的Markdown。
因此,在你的情况下,应写成:
<article markdown="1" class="post-content">
<!-- Contents of md files here in plain text-->
</article>

1
我有这行代码:
markdown_ext: "markdown, mkdown, mkdn, mkd, md"
它导致了问题。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接