jekyll - 在jekyll中,如何将变量解析为markdown而不是原样打印?

标签 jekyll

给定以下文件:

_data
  slides.yml

包括
- title: Slide one
  desc: |
    welcome to the slideshow
    This is an open-source slideshow, built with [deck.js](https://github.com/imakewebthings/deck.js), GitHub and [Jekyll](http://jekyllrb.com).

- title: Slide two
  desc: |
    Second slide with bullet points
     * Hello world
     * This is a slideshow

在我的index.html中
{% for slide in site.data.slides %}
  <section class="slide">
    <h2>{{ slide.title }}</h2>
    {{ slide.desc }}
  </section>
{% endfor %}

如何让Jekyll将{{slide.desc}}解释为 Markdown ?是否存在这样的事情:
...
{{ slide.desc AS markdown }}
...

谢谢!

阿尔伯特

最佳答案

找到了答案!

...
{{ slide.desc | markdownify }}
...

Here is the reference

关于jekyll - 在jekyll中,如何将变量解析为markdown而不是原样打印?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26695741/

相关文章:

angularjs - 更改 Jekyll 中的开始和结束符号,以避免 Angular 冲突

html - Jekyll:生成一次包含并将其包含到所有页面

javascript - Jekyll 未加载图像的 Javascript

github - 无法构建到 Github Pages

google-docs - 将Google文档转换为Jekyll Markdown

jekyll - 使用现有的 HTML 作为 Jekyll 帖子

linux - Jekyll 安装,参数数量错误

Jekyll:将变量从索引传递到帖子

jekyll - 将 susy 与 Jekyll 一起使用

javascript - 通过 JS 或任何小部件服务将文本发送到电子邮件