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

Changes to files starting with _site are not being picked up #22

Closed
kleinfreund opened this issue Jan 24, 2015 · 22 comments · Fixed by #65 · May be fixed by #29
Closed

Changes to files starting with _site are not being picked up #22

kleinfreund opened this issue Jan 24, 2015 · 22 comments · Fixed by #65 · May be fixed by #29

Comments

@kleinfreund
Copy link

kleinfreund commented Jan 24, 2015

I noticed that changes to files starting with _site are not being picked up by Jekyll when using jekyll s. Namely, I have the following file names. When I save one of them, the changes are not being picked up by Jekyll.

  • _sass/_site-head.scss
  • _sass/_site-logo.scss
  • _sass/_site-nav.scss
  • _includes/_site-head.html
@parkr
Copy link
Member

parkr commented Jan 24, 2015

This is because we're using regexp and have no special handling. I'd love to make this more like .gitignore

@parkr
Copy link
Member

parkr commented Mar 18, 2015

If someone sees this and wants to fix it, check out Listen's ignore directive. Right now we use regexp that basically just does a substring lookup.

@kleinfreund
Copy link
Author

I just forked this thing and tinker around a bit. I see that listen_ignore_paths returns something like a list containing _config.yml and _site (no other ignore paths passed). Am I right that everything containing these strings is currently not being watched? Whats the strategy here, then? We should a) only ignore the _config.yml file and b) ignore the whole _site directory.

Somehow, I currently run into a regeneration loop as soon as I touch a file that is not ignored.

@kleinfreund
Copy link
Author

Seems a little bit more complicated. I'm not sure how the can tell listen to ignore a directory. Can we distinguish between files and directories? Files would need something like /^filename\.ext$/ for an exact match. But directories? We only want to ingore that one _site directory. Nothing else containing this string.

@trkoch
Copy link

trkoch commented Jul 11, 2015

I also stumbled over this rather mean bug. My workaround is to export to _tmp.

@jekyllbot
Copy link
Contributor

jekyllbot commented Jun 6, 2016

This issue has been automatically marked as stale because it has not been commented on for at least
three months.

The resources of the Jekyll team are limited, and so we are asking for your help.

If you can still reproduce this error on the 3.1-stable or master branch,
please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, please consider building it first as a plugin. Jekyll 3 introduced
hooks which provide convenient access points throughout
the Jekyll build pipeline whereby most needs can be fulfilled. If this is something that cannot be
built as a plugin, then please provide more information about why in order to keep this issue open.

Thank you for all your contributions.

@jekyllbot jekyllbot added the stale label Jun 6, 2016
@kleinfreund
Copy link
Author

Yeah, this has never been fixed. Last time I tried, it still wasn’t working.

@parkr
Copy link
Member

parkr commented Jun 6, 2016

@kleinfreund Thanks for the reply! This may simply be a limitation of the way jekyll-watch works. Would it be enough to indicate change detected for '_sass/_site-head.scss' but matches exclude rule /_site/; ignored? Perhaps this could be fixed with a simple UX change.

@jekyllbot jekyllbot removed the stale label Jun 6, 2016
@parkr parkr added the ux label Jun 6, 2016
@kleinfreund
Copy link
Author

I don't think so. I worked on that a while back but eventually got stuck. Basically, the root _site should be matched for the exclude, not everything starting with _site.

@jekyllbot
Copy link
Contributor

This issue has been automatically marked as stale because it has not been commented on for at least one month.

The resources of the Jekyll team are limited, and so we are asking for your help.

If you can still reproduce this error on the 3.1-stable or master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, please consider building it first as a plugin. Jekyll 3 introduced hooks which provide convenient access points throughout the Jekyll build pipeline whereby most needs can be fulfilled. If this is something that cannot be built as a plugin, then please provide more information about why in order to keep this issue open.

Thank you for all your contributions.

@jekyllbot jekyllbot added the stale label Jul 6, 2016
@shellscape
Copy link

Chiming to add my "me too". Just ran across this with a Jekyll template that I've been working with.

@jekyllbot jekyllbot removed the stale label Aug 24, 2016
@jekyllbot
Copy link
Contributor

This issue has been automatically marked as stale because it has not been commented on for at least two months.

The resources of the Jekyll team are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, please consider whether it can be accomplished in another way. If it cannot, please elaborate on why it is core to this project and why you feel more than 80% of users would find this beneficial.

This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions.

@jasonschock
Copy link

Adding a "me too". This bit me and killed some time figuring out.

@deepfriedbrain
Copy link

I stumbled across the same issue and spent nearly 3 hours figuring out what was going on. Basically I had excluded a file called 'start' long ago. Today I created a folder called 'getting-started' and noticed that jekyll-watch was ignoring it during incremental builds. After lot of investigation, I stumbled upon this thread and figured out the problem. Is there a way to specify an exact match instead of a substring match in the exclude list?

@kleinfreund
Copy link
Author

This issue is not resolved. It needs to reopened.

@DirtyF DirtyF reopened this Apr 21, 2018
@parkr
Copy link
Member

parkr commented Apr 21, 2018

Anchoring the regexp should help here.

@ashmaroli
Copy link
Member

@kleinfreund et al, Would you guys be willing to test a fix for this..? Simply, add the following to your Gemfile, if interested.. Thanks in advance. 😃

# Gemfile

gem "jekyll-watch" , :git => "https://github.com/ashmaroli/jekyll-watch.git", :branch => "ignore-directory-paths"

@deepfriedbrain
Copy link

Apologies for the late response. I'm willing to test it. But can you explain how the fix is going to work so that I know what to test?

@ashmaroli
Copy link
Member

@deepfriedbrain You can start by testing if your issue is resolved.. i.e., if you exclude a 'file' called start, does jekyll-watch ignore changes to contents of getting-started folder..

Then you can test if the plugin ignores changes to a file with the relative-path _includes/_site-head.html and so on..

@deepfriedbrain
Copy link

It seems to be working well based on my testing.

DirtyF pushed a commit that referenced this issue Aug 23, 2018
The process of creating a relative path from an absolute one seems to
strip the trailing slash, identifying a path as a directory not a file.

When this is converted into a Regex for adding to the ignore list, it
also ignores files that start with the same name as ignored directories.

This fix simply checks whether there was originally a trailing slash,
then adds it again before it is converted into a regular expression.
AhmadFCheema added a commit to AhmadFCheema/Halve that referenced this issue Sep 4, 2018
…aseurl

    * _Gemfile.lock_ - Bundle update. `bundle install --full-index` did not
    * work. Had to individually update the gems (_listen_, and _jekyll-watch_)
    * which threw out the "... revealed dependencies not in the API or the
    * lockfile..." error during `bundle install`.

    * Updated `_layouts\compress.html` to
    * [v3.0.4](https://github.com/penibelst/jekyll-compress-html/releases/tag/v3.0.4)
    * (removed _p_, _rt_, and _rp_ from default endings list).

    * Renamed `assets\_sass\_site.scss` -> `assets\_sass\_main-site.scss`
    * because filenames beginning with `_site` are [not picked
    * up](jekyll/jekyll-watch#22) by
    * [jekyll-watch](https://github.com/jekyll/jekyll-watch). One possible
    * [workaround](jekyll/jekyll-watch#22 (comment)).

    * Changed `site.url` to `site.baseurl` in accordance with [this
    * comment](https://stackoverflow.com/questions/27386169/change-site-url-to-localhost-during-jekyll-local-development#comment43303379_27400343).
    * The changes were made in `_includes/head.html`, `_includes/scripts.html`
    * and `_layouts/home.html`.
@kleinfreund
Copy link
Author

Was this fixed? Can the issue be closed?

@DirtyF
Copy link
Member

DirtyF commented Oct 16, 2018

@kleinfreund not yet, #65 is still pending for review

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.