Reputation: 30528
I have a bunch of markdown files which I would like to publish on my website. I fiddled with Jekyll for a while and it seems like a nice tool to do so but my problem is that I would like to publish my files on other sites (like Medium) and FrontMatter gets in the way. I know that I can programmatically strip itfrom my markdown files but I am curious whether there is an official way to configure FrontMatter in an other way not involving putting it in my markdown files?
Upvotes: 7
Views: 699
Reputation: 706
There's a great plugin for that. It's called https://github.com/benbalter/jekyll-optional-front-matter. It just exactly what you asked for.
It's also supported by default on GitHub Pages › https://pages.github.com/versions/
Upvotes: 3
Reputation: 23952
Have your original markdown file in the same folder as the ones with the frontmatter and include one into the other.
For example create one post for the original.md
file called 2017-05-23-original.md
in _posts
:
---
layout: default
Rest of front matter...
---
{% include_relative original.md %}
The original file won't be processed and the other one will have all the Jekyll processing available.
You can also create another folder containing all the original markdown files and include them from Jekyll posts, you will have to exclude them somehow to make them not available in the generated site.
Upvotes: 2