# "Right place" for a directory of plugin-generated files?

**URL:** https://talk.jekyllrb.com/t/right-place-for-a-directory-of-plugin-generated-files/5538
**Category:** Uncategorized
**Created:** [January 24, 2021, 4:46pm UTC](https://talk.jekyllrb.com/t/right-place-for-a-directory-of-plugin-generated-files/5538 "2021-01-24T16:46:54Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![leahvelleman](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/leahvelleman/32/3182_2.png) [@leahvelleman](https://talk.jekyllrb.com/u/leahvelleman)
#### Post date: [January 24, 2021, 4:46pm UTC](https://talk.jekyllrb.com/t/right-place-for-a-directory-of-plugin-generated-files/5538/1 "2021-01-24T16:46:54Z")

</div>

I’m working on a plugin that needs to write source files, compile them by calling a separate binary, and use the compiled results. To avoid unnecessary recompilation, I want to keep the source files around between builds.

I’d like this to happen in a dedicated directory. It doesn’t need to be 100% private or protected, but I do want to make sure the source files I write don’t clobber anything else, and that existing user workflows don’t interfere with them — and giving them their own directory seems like the safest bet.

**Where in the source tree should this directory go? Is there a “right place” that the community acknowledges is best for this? If not, do you have suggestions?**

---

<div class="post-metadata">

### Author: ![AlfredoRamos](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/alfredoramos/32/3815_2.png) [@AlfredoRamos](https://talk.jekyllrb.com/u/AlfredoRamos)
#### Post date: [January 24, 2021, 9:42pm UTC](https://talk.jekyllrb.com/t/right-place-for-a-directory-of-plugin-generated-files/5538/2 "2021-01-24T21:42:17Z")

</div>

Welcome @leahvelleman 🎉

I’m not a plugin developer, but I guess as long as you don’t use a Jekyll directory you will be OK.

> **[Directory Structure](https://jekyllrb.com/docs/structure/)**
>
> A basic Jekyll site usually looks something like this:

You might want to prefix that directory with `_` (underscore) to prevent it from being copied to the generated website, inside the `_site` directory.

I’ve seen that some plugin/theme developers do it that way.

---

<div class="post-metadata">

### Author: ![MichaelCurrin](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/michaelcurrin/32/2340_2.png) [@MichaelCurrin](https://talk.jekyllrb.com/u/MichaelCurrin)
#### Post date: [January 25, 2021, 6:42am UTC](https://talk.jekyllrb.com/t/right-place-for-a-directory-of-plugin-generated-files/5538/3 "2021-01-25T06:42:13Z")

</div>

I only know of one example and this a plugin I forked.

```auto
cache/resize

```

It seems like a good pattern for multiple plugins to `cache` and their plugin name.

The `cache` folder is not reserved in Jekyll and will be copied into `_site` as it has has leading dot or underscore.

Just add this to ignore file.

```auto
cache/

```

> <https://github.com/MichaelCurrin/jekyll-resize/blob/master/docs/usage.md>

See also `.sass-cache` and `.jekyll-cache` as names for directories handled by Jekyll itself but of course not for output files because of leading dot. I’m guessing Jekyll generstes files in there if they don’t exist and then copies to `_site`. You might not need the two step process in your plugin.
