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:
parent
dd268fae95
commit
5b540cf744
|
@ -191,6 +191,10 @@ additional options:
|
||||||
png_dir: [PATH] # Where should the math PNGs be stored?
|
png_dir: [PATH] # Where should the math PNGs be stored?
|
||||||
png_url: [URL] # A relative URL for the PNGs
|
png_url: [URL] # A relative URL for the PNGs
|
||||||
|
|
||||||
|
exclude: # This is a YAML array for files in the root directory,
|
||||||
|
- file1 # which should be excluded to be processed into '_site'.
|
||||||
|
- file2 # This can be useful for README, Rakefiles etc.
|
||||||
|
|
||||||
The default configuration is shown below as in YAML format:
|
The default configuration is shown below as in YAML format:
|
||||||
|
|
||||||
destination: ./_site
|
destination: ./_site
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
module Jekyll
|
module Jekyll
|
||||||
|
|
||||||
class Site
|
class Site
|
||||||
attr_accessor :config, :layouts, :posts, :categories
|
attr_accessor :config, :layouts, :posts, :categories, :exclude
|
||||||
attr_accessor :source, :dest, :lsi, :pygments, :permalink_style
|
attr_accessor :source, :dest, :lsi, :pygments, :permalink_style
|
||||||
|
|
||||||
# Initialize the site
|
# Initialize the site
|
||||||
|
@ -17,6 +17,8 @@ module Jekyll
|
||||||
self.pygments = config['pygments']
|
self.pygments = config['pygments']
|
||||||
self.permalink_style = config['permalink'].to_sym
|
self.permalink_style = config['permalink'].to_sym
|
||||||
|
|
||||||
|
self.exclude = config['exclude']
|
||||||
|
|
||||||
self.reset
|
self.reset
|
||||||
self.setup
|
self.setup
|
||||||
end
|
end
|
||||||
|
@ -230,7 +232,7 @@ module Jekyll
|
||||||
entries = entries.reject do |e|
|
entries = entries.reject do |e|
|
||||||
unless ['_posts', '.htaccess'].include?(e)
|
unless ['_posts', '.htaccess'].include?(e)
|
||||||
# Reject backup/hidden
|
# 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
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue