def [](key)
Nanoc::NotificationCenter.post(:visit_started, self)
Nanoc::NotificationCenter.post(:visit_ended, self)
if key.to_s =~ /^content_for_(.*)$/
@@_content_for_warning_issued ||= false
@@_Nanoc_Helpers_Capturing_included ||= false
unless @@_content_for_warning_issued
warn 'WARNING: Accessing captured content should happen using the #content_for method defined in the Capturing helper instead of using item[:content_for_something]. The latter way of accessing captured content will be removed in nanoc 4.0.'
@@_content_for_warning_issued = true
end
unless @@_Nanoc_Helpers_Capturing_included
self.class.send(:include, ::Nanoc::Helpers::Capturing)
@@_Nanoc_Helpers_Capturing_included = true
end
return content_for(self, $1.to_sym)
end
@attributes[key]
end