I'm using kramdown
with Jekyll on GitHub Pages. I have a piece of markdown that I want to use twice, and don't want to maintain two versions of it. How can I include this in other markdown files?
For example, I want to type something like
{: include otherFile.md }
and have the contents of otherFile.md
rendered directly where this command is. Note that the parent file is also a markdown file, and not an HTML template.
Additional consideration: it would be great to be able to do this with the default GitHub pages workflow, and not have to use a plugin that is disabled by GH pages and have to push compiled versions of the site manually.
include_relative
worked for me, too. Although the example code on the Jekyll tutorial page only shows the case for embedding a .html file, it also works for .md files. – Dotdotage