Is there a way to not include FrontMatter in my markup files using Jekyll?

I have a bunch of markup files that I would like to publish on my website. I played with Jekyll for a while, and it seems to me that this is a good tool, but my problem is that I would like to publish my files on other sites (for example, Medium), and FrontMatter is in the way. I know that I can programmatically remove it from my markup files, but I'm curious if there is an official way to configure FrontMatter in a different way without linking it to placing in my markup files?

+4
source share
3 answers

You have the source layout file in the same folder as those that have frontmatter, and include them in another.

, original.md 2017-05-23-original.md _posts:

---
layout: default
Rest of front matter...
--- 

{% include_relative original.md %}

, Jekyll.

, , Jekyll, - , .

+2

, YAML, . , YAML, .

, --- , ,

0

There is a great plugin for this. It is called https://github.com/benbalter/jekyll-optional-front-matter . This is exactly what you requested.

It is also supported by default on GitHub › https://pages.github.com/versions/

0
source

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


All Articles