问题
Given the following file:
_data
slides.yml
which includes
- 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
In my index.html I have
{% for slide in site.data.slides %}
<section class="slide">
<h2>{{ slide.title }}</h2>
{{ slide.desc }}
</section>
{% endfor %}
How can I get Jekyll to interpret {{ slide.desc }} as markdown? Does something like this exist:
...
{{ slide.desc AS markdown }}
...
Thanks!
Albert
回答1:
Found the answer!
...
{{ slide.desc | markdownify }}
...
Here is the reference.
来源:https://stackoverflow.com/questions/26695741/in-jekyll-how-to-parse-a-variable-as-markdown-instead-of-printing-it-as-is