Eleventy: Error with manual passthrough copy on unsopported file extension

Created on 23 Nov 2018  路  4Comments  路  Source: 11ty/eleventy

Hello!

I am trying to use Manual Passthrough Copy to copy favicon files to _site directory.
I follow instructions outlined in this section of documentation, but I get an error

Error with passthrough copy: (full stack in DEBUG output)
> Having trouble copying './ico' (TemplatePassthroughManagerCopyError)
> ENOENT: no such file or directory, lstat './ico' (Error)

My platform:
Ubuntu 18.04, v8.11.4 (run from nvm).

Expected behaviour:
.ico file from root directory should be copied to _site directory.

What happens:
The file does not get copied, there is an error described above.

I made a little test case repository here:
https://github.com/halas/eleventy-passthrough-test
In the repository there is also file with full debug output.

I do hope I am just not misreading the documentation :)

And thanks for a fantastic work - I find eleventy super handy :)

education

Most helpful comment

Ah yes @danurbanowicz is correct here. If you want all ico files to be copied, you鈥檒l use the templateFormats method. If you want specific files or directories to be copied, you鈥檒l use the manual passthrough copy method.

I did add a few additional comments to https://www.11ty.io/docs/copy/#manual-passthrough-copy-(faster) to hopefully make the example a little bit more clear.

Please reopen if you have additional questions!

All 4 comments

I believe you either need to specify the filename to copy like this:-

eleventyConfig.addPassthroughCopy("favicon.ico");

Or add the file extension to your list of templateFormats and enable passthroughFileCopy e.g.

templateFormats: [
  "md",
  "njk",
  "ico"
],
passthroughFileCopy: true

I haven't tried the second method so do correct me if I'm wrong.

https://www.11ty.io/docs/copy/

Ah yes @danurbanowicz is correct here. If you want all ico files to be copied, you鈥檒l use the templateFormats method. If you want specific files or directories to be copied, you鈥檒l use the manual passthrough copy method.

I did add a few additional comments to https://www.11ty.io/docs/copy/#manual-passthrough-copy-(faster) to hopefully make the example a little bit more clear.

Please reopen if you have additional questions!

Ah, yes, now it is clear, sorry for the trouble. Thanks again!

No worries! The docs were ambiguous!

Was this page helpful?
0 / 5 - 0 ratings