Is there a way to disable static files being rendered inside collections?


#1

Continuing the discussion from here with @ashmaroli.
I’m using collections in my website, and I’ve been used to define the permalink of my collections inside their markdown file.

lets say I have these files:

_my_collection/
└── some_subdir
   └── some_doc.md
   └── some_pic.jpg

Normally it would render to this:

_site/my_collection/some_subdir/some_doc.html
_site/my_collection/some_subdir/some_pic.jpg

However I have defined permalink as /some/permalink/ in some_doc.md yaml frontmatter.

now the files would be rendered to

_site/some/permalink.html
_site/my_collection/some_subdir/some_pic.jpg

It is obvious that I want my pic some_pic.jpg to be beside my html file. Since it is not supported in core, I have used jekyll post file plugin with some tweaks to copy the file beside html. However now the file is in two places:

_site/some/some_pic.jpg
_site/my_collection/some_subdir/some_pic.jpg

How can I tell jekyll not to render collection static files?