I have a very similar issue to Excluding a directory from Jekyll watch, but I thought it was different enough to warrant it's own question.
_config.yml:
exclude: [
"my_ignored_directory"
]
Using jekyll build --watch
, the folder my_ignored_directory
will be successfully ignored from the watch task, but it will also not be built.
Is there are way to exclude a folder of my choosing from the --watch
task, but not to be excluded from being built?
(Note: there is no error in the console)
The answer is no, because excluded files for watch are :
_config.*
,destination folder
(usually_site
) and content ofconfig['exclude']
.See jekyll-watch code
Edit : But ...
We can override
Jekyll::Watcher::custom_excludes
methods with a plugin._plugins/jekyll-watcher-override.rb
In _config.yml, just set an
exclude_from_watch
variable :Now, when you do a
jekyll serve
any file / folder inexclude_from_watch
will be ignored if they change.