Search code examples
jekyll

Jekyll: Manually whitelist directories and files to be copied to _site directory


Is it possible to specify a list of files or directories that one would like copied to the _site directory? I would like to copy those files as is, in the way the webpack-copy-plugin lets one use webpack to copy files from on place to another.

The files I want to copy are in _includes, in case this complicates things. I know I could make a top level directory in my project for these files I want copied to _site, but I want to keep things tidy and place everything in _includes (Jekyll already makes lots of files and folders in my project root, and I don't want any more).

I tried specifying the value for include in _config.yml, but this doesn't seem to be copying file to _site.

Any suggestions others can offer would be helpful!


Solution

  • Curious, specifying in _config.yml:

    include:
      - _includes
    

    Copies over everything from _includes, while specifying:

    include:
      - _includes/assets
    

    does not copy over anything. I'll just use the former.