Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unrecognized files should be copied by default #162

Closed
alexgleason opened this issue Jul 5, 2018 · 7 comments
Closed

Unrecognized files should be copied by default #162

alexgleason opened this issue Jul 5, 2018 · 7 comments
Milestone

Comments

@alexgleason
Copy link

11ty is very nice, thank you!

However it was quite difficult to figure out how to get a normal site with images and CSS working. I don't really understand why configuration is required for this to work, which seems to go against 11ty being a "zero config" static site server.

In virtually every project I use this for, I am going to be required to include an .eleventy.js just so images and css copy over. I suggest making this the default.

@zachleat
Copy link
Member

zachleat commented Jul 5, 2018

Before I leave a lengthier comment, be aware that we do offer the --templateFormats command line option https://www.11ty.io/docs/config/#template-formats

@zachleat
Copy link
Member

zachleat commented Jul 6, 2018

Just so we’re clear up front—defaults changes are very contentious and require careful release management. And changing eleventy to copy everything would be a hell of a default to change. It could potentially leak sensitive files to production sites unintentionally.

So, I’m not sure I’m on board with changing the global default here—but I’m happy to discuss it.

My preference would be to be more surgical and include file extension types that provide some kind of value.

For example:

  • adding a css type that optionally outputs an additional minified file.
  • a png or jpg type that runs imageoptim and maybe outputs some different resolutions for srcset
  • a ttf type that outputs woff and woff2

I’d probably be open to just including the css and/or a few image types by default so that they’re copied without additional configuration. But global unrecognized files seems too broad and dangerous.

@zachleat zachleat added the needs-discussion Please leave your opinion! This request is open for feedback from devs. label Jul 6, 2018
@jmegs
Copy link

jmegs commented Jul 12, 2018

There are a couple of patterns I noticed that might help with this

  1. Jekyll copies directories and files relative to the source dir unless they're prefixed with an underscore. ./css/ is transferred ./_secrets/ isn't

  2. A lot of others have the notion of a dump dir or 'static' folder where the contents are output to the site root. ex. ./dumpDir/foo.css becomes ./foo.css in the output.

A lot comes down to whether you want to include any kind of asset pipeline outside of transforming templates > html. If there was a styles and image minification solution baked in like your above comment having a folder like /assets that you could watch for css/scss/styl files and jpg/png/svg images would be amazing

@zachleat
Copy link
Member

zachleat commented Aug 1, 2018

Related: #117

zachleat added a commit that referenced this issue Aug 4, 2018
…mplate or not). Will only process templates though. Requested by #162
@zachleat
Copy link
Member

zachleat commented Aug 4, 2018

I did a bit of work just to try this out. It’s currently in the passthroughall branch and is not available by default. It’s enabled using the --passthroughall cmd line option. It will copy everything in the input directory but will only process files that have a valid template extension.

@zachleat zachleat added this to the 0.5.3 milestone Aug 16, 2018
@zachleat zachleat added enhancement and removed needs-discussion Please leave your opinion! This request is open for feedback from devs. labels Aug 16, 2018
@zachleat
Copy link
Member

--passthroughall will be included with the next minor version.

@zachleat
Copy link
Member

Fixed by d44bfc7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants