file.json is outside
site.source, it won’t be seen by Jekyll under normal circumstances. The only way out would be write a plugin to include that file at runtime. Paste the following into a file at path
class Generator < Jekyll::Generator
site.static_files << Jekyll::StaticFile.new(site, site.source, "../", "file.json")
The next time you build your site, the
_site/file.json will be generated.
Disclaimer: The above code is untested and may or may not work locally but will definitely not work on GitHub Pages or if you build with