1

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

Ratnanil
  • 1,641
  • 17
  • 43

1 Answers1

1

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 }}.

Brad West
  • 943
  • 7
  • 19
  • oh man, I would not have found that! The trouble is, if I omit the `page.`, jekyll does crazy things with my remark markup. is there a way to use first inject the includes into my `default-presentation.md`, and then still use `page.content`? – Ratnanil Sep 28 '21 at 19:39
  • I'm not familiar with remark so I'm not sure what "crazy things" you're seeing, but maybe try creating a second layout. Pass `default-presentation.md` to the `presentation.html` layout using `{{ content }}`. Then pass that to a new layout, `default.html` perhaps, using the `{{ page.content }}` ...or maybe the reverse of that. – Brad West Sep 28 '21 at 20:18
  • Good idea! I've tried several things, haven't been successful yet. Will comment an update if i find a solution. – Ratnanil Sep 29 '21 at 07:36