Prevent files beginning with "---" in specified directory from being rendered by liquid without any changes in these files

I want to prevent liquid from rendering all files in specified directory even if file begins with --- without any changes in these files (these files are for downloading). Maybe I can put some lines in _config.yml or create file like .liquidignore?

you can ignore folders / files in the config file (exclude) - is that what you want? or do you still want to move them into the _site folder just without liquid doing anything?

there is also keepfiles which may do something for you.

1 Like

Copying files to _site directory and adding them to keep_files looks like good solution, but can I use wildcard with this option? I added

keep_files:
  - pages/*/raw

to _config.yml and this is not working. Maybe I made something wrong or wildcards are not supported by this option?

did you try it with 2 **? like pages/**/raw

Iā€™m not great at globbing but I think you need ** to do a directory? plus I think you need something on the end.

What is raw? a directory? or a file name? as you have it it almost looks like you want it to effect a file named raw in any subfolder of pages.

pages/raw/*.* would be any file in the raw directory.

What is raw? a directory? or a file name?

raw is directory.
Directory names are supported too. I added config:

keep_files:
  - downloads

And it keeps all files in downloads directory.

pages/raw/*.* would be any file in the raw directory.

Any file containing . in its name (files can have name without extension).

It looks like wildcards/regular expressions are not supported in current jekyll version. I suggested this feature on github. (https://github.com/jekyll/jekyll/issues/9523)