I expected many people to have asked this question but after hours of looking for a solution, I haven’t found what I need.
I use my website to host lecture material and that includes Markdown files (R Markdown files to be more specific, extension ‘Rmd’). Annoyingly, I haven’t found any way to tell Jekyll not to process .Rmd files — since the YAML preamble is gobbled up in the process (to no purpose, whatsoever, needless to say).
Rmd files are to be processed by R then rendered anyway; for that reason, a fairly obvious solution would be to be able to tell Jekyll, ‘you know what, whenever you see an Rmd file, deal with it as you would have done with a PDF or DOC file, just copy it as is’.
(Obviously, the idea of including an empty YAML frontmatter on top of a YAML-containing Rmd file is pretty revolting )
Does that possibility exist? Because I haven’t found it.
If a file has the two lines of --- Jekyll will process the file.
If you want it to ignore Markdown files or any other file just omit those lines.
For example say I have /lectures/lecture-1.md and it has Markdown content in it. Jekyll will ignore it and place it in _site/lectures/lecture.md untouched.
If the Rmd files are in their own folder, you could add it to the exclude list in _config.yml.
UPDATE: I entirely forgot to mention that you would then need a Gulp task or something similar to copy the files to your _site folder. Sorry for any confusion!