mirror of
https://github.com/jekyll/jekyll.git
synced 2026-04-28 03:01:03 -04:00
introduce an exclude config option
This is a YAML array for files in the root directory, which should be excluded to be processed into '_site'. This can be useful for README, Rakefiles etc.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
module Jekyll
|
||||
|
||||
class Site
|
||||
attr_accessor :config, :layouts, :posts, :categories
|
||||
attr_accessor :config, :layouts, :posts, :categories, :exclude
|
||||
attr_accessor :source, :dest, :lsi, :pygments, :permalink_style
|
||||
|
||||
# Initialize the site
|
||||
@@ -17,6 +17,8 @@ module Jekyll
|
||||
self.pygments = config['pygments']
|
||||
self.permalink_style = config['permalink'].to_sym
|
||||
|
||||
self.exclude = config['exclude']
|
||||
|
||||
self.reset
|
||||
self.setup
|
||||
end
|
||||
@@ -230,7 +232,7 @@ module Jekyll
|
||||
entries = entries.reject do |e|
|
||||
unless ['_posts', '.htaccess'].include?(e)
|
||||
# Reject backup/hidden
|
||||
['.', '_', '#'].include?(e[0..0]) or e[-1..-1] == '~'
|
||||
['.', '_', '#'].include?(e[0..0]) or e[-1..-1] == '~' or self.exclude.include?(e)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user