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

ignore doesn't accept wildcards? #90

Open
mohkale opened this issue Dec 28, 2019 · 0 comments · May be fixed by #93
Open

ignore doesn't accept wildcards? #90

mohkale opened this issue Dec 28, 2019 · 0 comments · May be fixed by #93

Comments

@mohkale
Copy link

mohkale commented Dec 28, 2019

This is in part related to issue 7888 on the official jekyll repo.

Right now I've got an exclude section in my yaml like the following:

exclude:
  - node_modules/
  - vendor/
  - assets/ascii/*.md
  - assets/gpg/*.private.gpg
  - "*.rb"
  - "**/.#*"

The really annoying part here is that unless an absolute path for these entries exist, jekyll-watch doesn't include them in the list of paths to be ignored. see here for what I mean. Meaning even if jekyll itself won't output a hello.rb file to the build directory, jekyll-watch will rebuild the site because a path like /path/to/my/site/*.rb doesn't exist.

A secondary annoyance is that jekyll itself uses File.fnmatch? for checking if a path should be excluded, whereas Listen (I believe) uses regular expressions :(. This means that our build exclude and our watch exclude don't match properly.

My proposal is to keep what we have, add a section to the README explaining how jekyll-exclude only accepts some of the entries in our configs exclude section (exactly those for which a valid file exists) & add a new section to our configs watch_exclude consisting of regular expressions like "^\.jekyll\-metadata!" which we simply include in our ignore list altogether. This probably means there'll be some overlap between watch_exclude and exclude... but it's better than outright ignoring most of our exclude values.

A better solution would be somehow converting fnmatch paths to regular expressions or requesting that the Listen library uses fnmatch for strings and regular expressions seperately (like jekyll does at the moment).

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

Successfully merging a pull request may close this issue.

2 participants