Placing assets in subdirectories breaks LiveReload #56

dcalhoun opened this Issue Dec 20, 2013 · 2 comments


None yet
2 participants

dcalhoun commented Dec 20, 2013


Jekyll's exclude option in _config.yml doesn't appear to accept subdirectories.


The default configuration for the JavaScript directory is js. If during the configuration you choose to place it in a subdirectory, say assets/js, it breaks the LiveReload of the JavaScript.

From my testing, it seems that Jekyll's _config.yml exclude option does not accept paths to subdirectories. You may only pass file or folder names. Jekyll is ignoring requests to exclude assets/js and the JavaScript (and any other asset in a subdirectory) is copied to the .jekyll directory. The server looks in the .jekyll directory for assets prior to looking in app.

This isn't an issue when using CoffeeScript compilation as the CoffeeScript files are compiled into .tmp. The server looks in .tmp before looking into .jekyll or app, so it ignores the fact that the JavaScript files are in .jekyll. Note: I haven't tested it, but I'm would imagine this would happen with CSS v Sass as well.

Possible Solutions

  1. Ask the user if they would like to place all the assets in a subdirectory. If they provide a directory to place all the assets, then add that directory to the exclude array rather than each asset directory.
  2. Copy the JavaScript from app to .tmp on save, as the server would look there first.
  3. Not allow subdirectories for assets. 😦



robwierzbowski commented Dec 20, 2013

Great report. Can you:

  • Post your _config.yml (or the relevant parts of it)?
  • Check the Jekyll issue tracker and see if this is a known bug (hopefully with some known workarounds we can add to the generator)?

dcalhoun commented Dec 20, 2013

It looks like this is just the way Jekyll's _config.yml exclude option works currently. You can successfully exclude assets/js by listing js in the exclude array. The only downside is that this will globally exclude any directory named "js". Hopefully that won't be an issue for generator-jekyllrb users.

I'll put together a PR with a fix.

@dcalhoun dcalhoun pushed a commit to dcalhoun/generator-jekyllrb that referenced this issue Dec 20, 2013

David Calhoun Fix LiveReload for asset subdirectories. Fixes #56. 3da361a

@robwierzbowski robwierzbowski added a commit that referenced this issue Dec 28, 2013

@robwierzbowski robwierzbowski Refine exclude dir generation
fixes #56
fixes #57

@dcalhoun dcalhoun pushed a commit to dcalhoun/generator-jekyllrb that referenced this issue Jan 2, 2014

David Calhoun Merge remote-tracking branch 'upstream/master'
* upstream/master:
  Bump version to 1.1.0
  Add README note on nested directories
  Refine exclude dir generation
  Fix LiveReload for asset subdirectories. Fixes #56.
  Add private: true to the default package.json
  Clean up bundle install logic, add a warning message if it fails at end of install
  Move coffeelint reference in readme
  Revert bundler sequence to repair creation of default Jekyll site.
  Move coffeelint task with like tasks
  Add lint task for coffee files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment