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

How to use collections with ignore? #58

Closed
julkue opened this issue Apr 8, 2016 · 2 comments
Closed

How to use collections with ignore? #58

julkue opened this issue Apr 8, 2016 · 2 comments

Comments

@julkue
Copy link

julkue commented Apr 8, 2016

I am having a one-page that should include some collections. But, I don't want to generate those include files. So I am using .ignore("mypath") like described in the docs. However, when using ignore after or before using collections, those include files will be deleted from the stack of the collection. So, how can I use ignore but still get even ignored files into the stack of collections?

I am aware that this repository is not actively maintained, so in the meantime I will either don't use this plugin or delete the ignore files after using metalsmith.

@GRUBES
Copy link

GRUBES commented Apr 20, 2016

Just adding my voice as I'm struggling with this, too. Would like to be able to basically say "Add all of markdown files in folder abc except files named blah".

Was trying to employ some of the concepts described here but didn't get anything to stick.

@webketje
Copy link
Member

webketje commented Feb 2, 2022

Metalsmith.ignore always executes before any plugins run. Use @metalsmith/remove to remove files after they have been used by other plugins. As for excluding certain files inside a same folder, you would use a negated pattern along with a regular glob pattern, like so: ['abc/**/*.md', '!abc/blah.md']

@webketje webketje closed this as completed Feb 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants