11ty / eleventy-base-blog

A starter repository for a blog web site using the Eleventy static site generator.
https://eleventy-base-blog.netlify.app/
MIT License
1.21k stars 619 forks source link

Separate source subdirectory within root? #82

Closed switch-to-gitlab closed 2 years ago

switch-to-gitlab commented 3 years ago

I got tripped up by the directory structure.

This happened because I was npm installing a package that had a README.md into a scripts/ folder I was passing through. I figure this is a fairly common use case.

If I submitted a PR that put the source into a subdirectory, would you accept?

zachleat commented 3 years ago

Ah I think it would be more straightforward to add an ignore for node_modules directories right? Probably in .eleventyignore

switch-to-gitlab commented 3 years ago

@zachleat If I understand correctly, that would prevent the node_modules folder from being included in the output site entirely, right?

I need node_modules to be there because it contains runtime dependencies of my scripts, so I need it to be passed through, but without any additional processing by eleventy.

zachleat commented 3 years ago

Ah perhaps not-obviously .eleventyignore only applies to the file extension search from templateFormats (not manual passthrough copy files, e.g. addPassthroughCopy method). Specifically step #1 in the order of operations: https://www.11ty.dev/docs/advanced-order/

zachleat commented 2 years ago

Also worth noting here that https://github.com/11ty/eleventy/issues/383 changed the default behavior in 1.0 to always ignore root node_modules/**

zachleat commented 2 years ago

This is an automated message to let you know that a helpful response was posted to your issue and for the health of the repository issue tracker the issue will be closed. This is to help alleviate issues hanging open waiting for a response from the original poster.

If the response works to solve your problem—great! But if you’re still having problems, do not let the issue’s closing deter you if you have additional questions! Post another comment and we will reopen the issue. Thanks!