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

feat: Add wildcards/regular expressions support to all options in _config.yml #9523

Open
t1m013y opened this issue Jan 10, 2024 · 4 comments
Labels

Comments

@t1m013y
Copy link

t1m013y commented Jan 10, 2024

Summary

My idea is to add wildcards/regular expressions support for all options in config file (_config.yml) that accepts file or directory (e.g. include, exclude, keep_files)

Motivation

I think this feature should be added to jekyll core because most text/code editors create additional files in project directory and they are not always in separate directory. I thint it would be comfortably to exclude these files by adding few regexp lines to config file instead of manually adding each file to ignore list.

Drawbacks

I don't see any big drawbacks in this feature. Maybe it can conflict with file/directory names that contains regexp characters like ^ or $ but I think it is unlikely that someone will create files/directories with regexp-like names. Also I have idea to add additional options like exclude_regexp, keep_files_regexp etc to avoid conflicts with usual files/directories names.

@mattr-
Copy link
Member

mattr- commented Jan 12, 2024

Wildcards haven't traditionally been supported in those fields because they're unsafe due to path traversal attacks. While path traversal attacks don't have the same impact on a static site generator compared to a web server, we do need to be aware of and mitigate the problem somehow.

I would welcome a PR to support glob wildcards for these fields but adding regular expression support for these fields is not something I'm in favor of adding.

@t1m013y
Copy link
Author

t1m013y commented Jan 12, 2024

Wildcards haven't traditionally been supported in those fields because they're unsafe due to path traversal attacks.

How about adding separate options like exclude_regexp etc and printing warning if they are used?

@mattr-
Copy link
Member

mattr- commented Jan 12, 2024

Wildcards haven't traditionally been supported in those fields because they're unsafe due to path traversal attacks.

How about adding separate options like exclude_regexp etc and printing warning if they are used?

No. Our config is full of too many options as it is.

@t1m013y
Copy link
Author

t1m013y commented Jan 12, 2024

Ok. Maybe I will make plugin later.

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

No branches or pull requests

2 participants