jekyll/jekyll

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

t1m013y opened this issue · 4 comments

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.

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.

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?

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.

Ok. Maybe I will make plugin later.