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

**URL:** <https://talk.jekyllrb.com/t/prevent-files-beginning-with-in-specified-directory-from-being-rendered-by-liquid-without-any-changes-in-these-files/8838>\
**Category:** Help\
**Created:** [January 9, 2024, 4:51pm UTC](https://talk.jekyllrb.com/t/prevent-files-beginning-with-in-specified-directory-from-being-rendered-by-liquid-without-any-changes-in-these-files/8838 "2024-01-09T16:51:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![t1m013y](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/t1m013y/32/5711_2.png) [@t1m013y](https://talk.jekyllrb.com/u/t1m013y)\
**Post date:** [January 9, 2024, 4:51pm UTC](https://talk.jekyllrb.com/t/prevent-files-beginning-with-in-specified-directory-from-being-rendered-by-liquid-without-any-changes-in-these-files/8838/1 "2024-01-09T16:51:02Z")

</div>

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`?

---

<div class="post-metadata">

**Author:** ![rdyar](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/rdyar/32/710_2.png) [@rdyar](https://talk.jekyllrb.com/u/rdyar)\
**Post date:** [January 9, 2024, 10:08pm UTC](https://talk.jekyllrb.com/t/prevent-files-beginning-with-in-specified-directory-from-being-rendered-by-liquid-without-any-changes-in-these-files/8838/2 "2024-01-09T22:08:08Z")

</div>

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.

> **[Configuration Options](https://jekyllrb.com/docs/configuration/options/)**
>
> The tables below list the available settings for Jekyll, and the various options (specified in the configuration file) and flags (specified on the command-line) that control them.

---

<div class="post-metadata">

**Author:** ![t1m013y](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/t1m013y/32/5711_2.png) [@t1m013y](https://talk.jekyllrb.com/u/t1m013y)\
**Post date:** [January 10, 2024, 4:22pm UTC](https://talk.jekyllrb.com/t/prevent-files-beginning-with-in-specified-directory-from-being-rendered-by-liquid-without-any-changes-in-these-files/8838/4 "2024-01-10T16:22:24Z")

</div>

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

```yaml
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?

---

<div class="post-metadata">

**Author:** ![rdyar](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/rdyar/32/710_2.png) [@rdyar](https://talk.jekyllrb.com/u/rdyar)\
**Post date:** [January 10, 2024, 6:31pm UTC](https://talk.jekyllrb.com/t/prevent-files-beginning-with-in-specified-directory-from-being-rendered-by-liquid-without-any-changes-in-these-files/8838/5 "2024-01-10T18:31:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![t1m013y](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/t1m013y/32/5711_2.png) [@t1m013y](https://talk.jekyllrb.com/u/t1m013y)\
**Post date:** [January 10, 2024, 6:36pm UTC](https://talk.jekyllrb.com/t/prevent-files-beginning-with-in-specified-directory-from-being-rendered-by-liquid-without-any-changes-in-these-files/8838/6 "2024-01-10T18:36:43Z")

</div>

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

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

```yaml
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).

---

<div class="post-metadata">

**Author:** ![t1m013y](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/t1m013y/32/5711_2.png) [@t1m013y](https://talk.jekyllrb.com/u/t1m013y)\
**Post date:** [January 10, 2024, 6:40pm UTC](https://talk.jekyllrb.com/t/prevent-files-beginning-with-in-specified-directory-from-being-rendered-by-liquid-without-any-changes-in-these-files/8838/7 "2024-01-10T18:40:46Z")

</div>

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](https://github.com/jekyll/jekyll/issues/9523))
