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 skip_render all files start_with "abc" #3306

Closed
xu-song opened this issue Oct 25, 2018 · 7 comments
Labels

Comments

@xu-song
Copy link

@xu-song xu-song commented Oct 25, 2018

Environment Info

Node version(node -v): v10.3.0

For question

skip_render:
  - **/abc**

the above config does not work

#1146

@curbengh

This comment has been minimized.

Copy link
Contributor

@curbengh curbengh commented Oct 30, 2018

"**/*/abc*" with double quotes WFM

@xu-song

This comment has been minimized.

Copy link
Author

@xu-song xu-song commented Oct 30, 2018

thanks
where can i find the source code of regular expression?

@curbengh

This comment has been minimized.

Copy link
Contributor

@curbengh curbengh commented Oct 30, 2018

hexo uses minimatch module.

result.renderable = ctx.render.isRenderable(path) && !common.isMatch(path, ctx.config.skip_render);

exports.isMatch = (path, patterns) => {
if (!patterns) return false;
if (!Array.isArray(patterns)) patterns = [patterns];
patterns = patterns.filter(value => value);
if (!patterns.length) return false;
for (let i = 0, len = patterns.length; i < len; i++) {
if (minimatch(path, patterns[i])) return true;
}
return false;
};

@xu-song

This comment has been minimized.

Copy link
Author

@xu-song xu-song commented Oct 30, 2018

thanks

@curbengh

This comment has been minimized.

Copy link
Contributor

@curbengh curbengh commented Oct 30, 2018

you may close this if resolved.

@xu-song xu-song closed this Oct 30, 2018
@xu-song

This comment has been minimized.

Copy link
Author

@xu-song xu-song commented Nov 4, 2018

It only skip the file. What about directory and subdirectory start with abc?

"**/*/abc**", "**/abc**" does not work

update

"**/abc*/**" works

@xu-song xu-song reopened this Nov 4, 2018
@stale

This comment has been minimized.

Copy link

@stale stale bot commented Jan 3, 2019

This issue has been automatically marked as stale because lack of recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.