More ignores
This commit is contained in:
parent
0309753561
commit
5760d64ef9
2 changed files with 10 additions and 2 deletions
|
@ -52,6 +52,9 @@ module Middleman::CoreExtensions
|
||||||
resource.add_metadata options: opts, page: fmdata
|
resource.add_metadata options: opts, page: fmdata
|
||||||
|
|
||||||
# TODO: resource.ignore! if ignored
|
# TODO: resource.ignore! if ignored
|
||||||
|
# TODO: This doesn't really work because resources can't themselves be ignored / when
|
||||||
|
# an ignore rule is in place it's forever
|
||||||
|
resource.ignore! if ignored == true && !resource.proxy?
|
||||||
|
|
||||||
# TODO: Save new template here somewhere?
|
# TODO: Save new template here somewhere?
|
||||||
end
|
end
|
||||||
|
|
|
@ -48,11 +48,16 @@ module Middleman
|
||||||
|
|
||||||
# Helpers methods for Resources
|
# Helpers methods for Resources
|
||||||
module IgnoreResourceInstanceMethods
|
module IgnoreResourceInstanceMethods
|
||||||
|
# Ignore a resource directly, without going through the whole
|
||||||
|
# ignore filter stuff.
|
||||||
|
def ignore!
|
||||||
|
@ignored = true
|
||||||
|
end
|
||||||
|
|
||||||
# Whether the Resource is ignored
|
# Whether the Resource is ignored
|
||||||
# @return [Boolean]
|
# @return [Boolean]
|
||||||
def ignored?
|
def ignored?
|
||||||
# Check frontmatter/data
|
return true if @ignored
|
||||||
return true if !proxy? && data[:ignored] == true
|
|
||||||
# Ignore based on the source path (without template extensions)
|
# Ignore based on the source path (without template extensions)
|
||||||
return true if @app.sitemap.ignored?(path)
|
return true if @app.sitemap.ignored?(path)
|
||||||
# This allows files to be ignored by their source file name (with template extensions)
|
# This allows files to be ignored by their source file name (with template extensions)
|
||||||
|
|
Loading…
Add table
Reference in a new issue