markdownjekyllstatic-siteremarkjsstatic-site-generation

Using jekyll's "includes" with remark


I'm happily using remark with jekyll. Jekyll let's me work with a template file, as it is descrbed in the wiki.

I would also like to use jekyll's include command in my slides, e.g. {% include something.html %}. But somehow, I cant get this working: when I build my slides, the command {% include something.html %} is parsed literally into my slide (see screenshot below).

The content of my default-presentation.md file is below, where as _includes/test.html contains just <p>test</p>. I've also created a minimal repo containing all the files, here.

Full disclosure: I also asked this question via a github issue

---
layout: presentation
title: Default Presentation
permalink: /default-presentation/
---

# My Awesome Presentation

{% include test.html %}

Screenshot 2021-09-25 at 23-59-13 Default Presentation


Solution

  • In your _layouts/presentation.html file, you are calling {{ page.content }}. The page. part of that is calling the content from that page as-is. If you want Jekyll to parse content you should use {{ content }}.