-
Notifications
You must be signed in to change notification settings - Fork 12
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 ignore a folder? #5
Comments
I had the exact same problem as you. You might have invisible dotfile in your less directory. If you also delete dotfiles, it should work. Here is my (working) configuration: .use(ignore([ // use ignore as soon as possible is important as it lowers the build time
'js/bootstrap/**', // ignore bootstrap files
'js/bootstrap/**/.*' // ignore bootstrap hidden files
])) Hope this helps! |
I'm also confused about this. It doesn't appear very semantic to use a glob if you simply want to ignore a directory entirely. Ideally we could just put the folder name:
|
In other words, you must explicitly ignore hidden files in addition to the directory if you want to ignore an entire directory that contains hidden file. |
Thanks, @oupala. 👍 |
Why not just use |
Thanks @julmot for this interesting suggestion. I tried it just now and did not managed to make it work. I replaced this: .use(ignore([
'images/logo.svg'
])) by this: .ignore(
'images/logo.svg'
) And my logo.svg file is no more ignored. |
@oupala The |
I think I am correctly referencing the file (as the source dir is .source('./src/') $ ls -l src/images/logo.svg
-rw-r--r-- 1 myuser myuser 4694 juil. 2 2015 src/images/logo.svg By the way, I'm also using arrays when I need to ignore more than one item. |
@oupala For me, it works like a charm. |
Well, for me, it really doesn't... :-) Does anyone has an idea about why it doesn't work in some cases, and which ones? I had a look at the official documentation about ignore and I found nothing special about this feature. One last question, if metalsmith-ignore can be easily replaced by the |
@oupala Did you tried other filenames? Can you please post your full code that is necessary to execute Metalsmith? Regarding your question, I think this plugin still exists due to compatibility reasons. However, it should still be mentioned in the README of this repository that it is not necessary anymore. But I think that this company has shown, that even if there are very much open issues for years now, they created it because of self-interest. |
When using These syntaxes works: .ignore([
'**/src/images/logo.svg'
]) .ignore([
'**/images/logo.svg'
]) .ignore([
'**/logo.svg'
]) .ignore([
'logo.svg'
]) But it seems that - if you wan to add some dir in the path - the path must be prepended by Is there a way to specify a path relative to the source directory? Something like: .ignore([
'images/logo.svg'
]) or .ignore([
'src/images/logo.svg'
]) |
Thanks @oupala for that, ignoring a directory now works for me! |
Here's my
metalsmith.json
:It ignores all
*.less
files, but still copiesless/
directory into the build folder.Here are all the patterns I tried so far:
Any suggestions?
The text was updated successfully, but these errors were encountered: