Can I use markdown in Jekyll 1.5.1 layouts?

In Jekyll 1.5.1, my layouts are parsed, but the markdown is ignored.

Is there any way around this?

Here is my layout post.md

---
layout: default
---
<h2>{{ page.title }}</h2>
<p class="meta"></p>

<div class="post">
{{ content }}
</div>

* first
* second
* third

# hi

The title, contents and layout are matched, so I know that Jekyll parses the file.

I expect the first and third to be on the list, and I expect hi to be h1, but they won’t get markdown, while other files such as test.mddo (actually test.md even uses this layout).

+4
source share
2 answers

I wanted to include a submenu for a specific subdirectory in my default layout. I got it to work as follows:

{% if page.url contains '/for-citizens/'' %}
  {% capture submenu %}{% include for-citizens-menu.md%}{% endcapture %}
  <div class="navbar-collapse collapse">
    <ul id="navList" class="nav navbar-nav">
      {{ submenu | markdownify }}
    </ul>
  </div>
{% endif %}
+1
source

"" , , , Jekyll HTML.

, , , Jekyll, - , .html .
, , Jekyll .md , Markdown.

, : .
.html Markdown HTML, .

, .

+1

Source: https://habr.com/ru/post/1543778/


All Articles