More ignores
This commit is contained in:
parent
0309753561
commit
5760d64ef9
|
@ -52,6 +52,9 @@ module Middleman::CoreExtensions
|
|||
resource.add_metadata options: opts, page: fmdata
|
||||
|
||||
# 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?
|
||||
end
|
||||
|
|
|
@ -48,11 +48,16 @@ module Middleman
|
|||
|
||||
# Helpers methods for Resources
|
||||
module IgnoreResourceInstanceMethods
|
||||
# Ignore a resource directly, without going through the whole
|
||||
# ignore filter stuff.
|
||||
def ignore!
|
||||
@ignored = true
|
||||
end
|
||||
|
||||
# Whether the Resource is ignored
|
||||
# @return [Boolean]
|
||||
def ignored?
|
||||
# Check frontmatter/data
|
||||
return true if !proxy? && data[:ignored] == true
|
||||
return true if @ignored
|
||||
# Ignore based on the source path (without template extensions)
|
||||
return true if @app.sitemap.ignored?(path)
|
||||
# This allows files to be ignored by their source file name (with template extensions)
|
||||
|
|
Loading…
Reference in a new issue