I wanted to exclude assets/sass from being included into the generated _site:
However it still includes assets/sass. I tried adding a trailing slash, putting it inside quotation marks but none works?
Use sass instead of assets/sass. :)
@Apathetic012 you can also put the directories / files you want to exclude in an array like
[sass, readme.md, config.rb]
@Apathetic012 Add this in your config.yml file and see if it does it:
More info on Jekyll Configuration Settings Wiki
Alternatively, if possible, just add an _ (underscore) to the name of the directories you want to exclude. So, in your case, rename sass to _sass.
@aahan I tried that as well. No dice
In the docs it says that adding a trading slash will work with sub dirs
I think we should start an issue.
I had the same problem just a couple of hours ago.
Adding an underscore is no option (e.g. for Gemfile, Capfile, ...)
IMO there are at least two problems with exclude:
1. The behaviour is not documented correctly (or not implemented as intended...):
$ ls -R
_config.yml dir1 dir2 dir3 dir4 index.md
$ cat _config.yml
$ jekyll --no-auto --no-server
$ ls -R _site
dir1 dir2 dir4 index.html
2. It should be possible to specify a full path and exclude only a specific file in a specific directory (exclude: README.md will exclude all README.md files in the complete directory tree).
@jwebcat Well, we already did, didn't we? And I agree with you. I am starting to see a couple of things, not working as described in Jekyll docs (for example).
@aahan agreed :) as we would obviously like to have the same name for multiple different locations as with
as @stomar points out this kind of seems like a no-brainer that it should be an option.
Or at the very least we could know how it is done, although I have tried every possibility I could think of with no dice.
I believe the current "options" are:
I guess my last resort for now is to prepend an underscore to the directory.
@parkr any chance this is coming with the next release?
@Apathetic012, do you use stable or beta? I use the same structure as you, ie: assets/sass, and I can exclude the folder by having exclude: ["sass"] in my config file.
@gummesson my version's Jekyll 0.12.1.
EDIT: I updated to jekyll 1.0.0.beta2 and I do can ignore the folder through it's name. I guess I should close this?
@Apathetic012, as long as you do not have another file/directory sass in the directory tree, exclude: sass should work fine.
I think the issue should be kept open.
@stomar I agree this seems like a no brainer.
It's almost pointless to attempt a PR as almost all new features are bring shot down by the elders in charge of Jekyll with the excuse that it will make Jekyll too complex.
... it seems like we're in a kind of waiting zone until new features are ok'ed by @mojombo . I know there are a lot of things to take into account with each new feature request.
Other wise I guess we can make a fork that will be more conformist to obvious public needs and features requests, instead of some kind of personal blog project that github happens to be using for hmm pages, and everyone is using and contributing to.
incremental regeneration for example is one thing I flat out need if I see myself using Jekyll much longer.
I can confirm the following:
We intend to update the documentation before 1.0.0 is released. If you'd like to accelerate the release and reduce your frustration, I highly suggest helping out to make the docs match what is implemented. The help would be gladly welcome. You may also submit a pull request for the particular behavior you want and we can discuss what the desired functionality should be. In the meantime, I've adjusted the wiki page to remove the comment about the trailing slash, since it doesn't apply
@mattr- wonderful 👍 I am more than willing to help update the docs.
I'm just guessing but the behavior of include is probably similar and would have to be considered also for future feature or pull requests.
The documentation is not clear about the precedence of exclude and include.
1.0 betas support glob exclusion. assets/sass/**/* should work.
@parkr include behaves the same then I imagine right?
I believe so.
@parkr cool. I will test it.
I Would love your opinion on this rakefile I made for Jekyll https://github.com/jwebcat/rake-jekyll-grunt.git it uses grunt and live reload. My ruby is super basic and I imagine could be improved.
Any thoughts on how I should exclude only a root directory or file.
From the source Jekyll directory I want to ignore ./vendor
Ignores all vendor folders anywhere
Other options I've tried
Just tried, no dice.
Yeah that solves my problem, but I thought I would bring up that this type of matching doesn't work. I would have expected it to work much like gitignore. For now I'll use underscores.
As I already stated 6 months ago, I still think there should be a way to exclude /vendor but not /some_dir/vendor.
ignore test directories from build
should fix HTML::Proofer build errors:
Glob ignores don't seem to work in 1.3.1. With the directory assets/js,
assets/js doesn't exclude
assets/js/**/* doesn't exclude
js excludes, but of course excludes all other js directories too.
Any other workarounds / fixes for nested excluded directories?
In case this helps anyone else, I was having trouble getting Jekyll to exclude Grunt generated files and directories without an underscore. I thought there was something wrong with my syntax, but when I restarted Terminal after editing the config file, it finally worked. Here's what my exclude looks like:
exclude: [node_modules, package.json, npm-debug.log, Gruntfile.js, scss]
bit surprised that this is still an issue after a year.
Thank you, that's good to know!
I format my excludes this way. Doesn't matter as long as it's yaml. The behavior is the same. I use a few keywords to ignore directories because Jekyll doesn't support glob in excludes. It'll be cool when 2.x comes out and adds that though.
Hello. I am from the future, specifically February 2015. This issue is still not resolved. It is possible to exclude a folder by putting its exact name in the exclude. If the folder's name is, say, xyzzy, you can put
xyzzy, or xyzzy/ and the folder will be excluded.
If you say xyzzy/foo.bar, it appears that you cannot exclude just foo.bar.
If you say xyzzy, not xyzzy/, the folder will be excluded and so will any file (and folder?) containing the string 'xyzzy', such as article-about-xyzzy-magic-word.md
File watch does not interpret the things in exclude the same way that jekyll generation does. It is possible to set things up so that watch will not trigger but jekyll will generate the file if started manually. I believe it is possible to do the reverse.
There are essentially zero working examples anywhere. I would wager that there are no working tests or checks as well, since if there were someone would surely have published them by now.
This is not the end of the world. I'll write to you about that later. But it is not particularly good nor impressive.
+1 to what @RonJeffries said... this issue seems to have re-appeared.
I have been using the following include configuration for the past 6 months to ensure that the entire contents of my sass directory are copied for purposes of source mapping... It was working until a few days ago.
The only way I can get the underscored files / directories in my sass directory to be copied during build - is by changing my include to:
This is sub-optimal, however, because it now copies the entirety of _includes, _layouts, _data, etc.
@parkr @mojombo should a new issue be opened - or is this issue still an appropriate place to investigate possible regressions?
Using jekyll 2.4.0
Thanks for your time.
I am strugling with this as well, with Jekyll 2.5.3.
I have a tags folder in the root, and I want its content to be added to the _site/tags/ folder that is generated by the jekyll tagging plugin.
I tried several syntaxes, from the comments in this thread, with no result.