module Middleman::CoreExtensions::Data::InstanceMethods

def data

Returns:
  • (DataStore) -
def data
  @data ||= DataStore.new(self)
end

def data_callback(name, &block)

Returns:
  • (void) -

Parameters:
  • name (Symbol) -- Name of the data, used for namespacing
def data_callback(name, &block)
  DataStore.data_callback(name, block)
end

def data_content(name, content)

Returns:
  • (void) -

Parameters:
  • content (Hash) -- The content for this data
  • name (Symbol) -- Name of the data, used for namespacing
def data_content(name, content)
  DataStore.data_content(name, content)
end

def initialize

parsing config.rb
Setup data files before anything else so they are available when
def initialize
  file_changed DataStore.matcher do |file|
    data.touch_file(file) if file.match(%r{^#{data_dir}\/})
  end

  file_deleted DataStore.matcher do |file|
    data.remove_file(file) if file.match(%r{^#{data_dir}\/})
  end
  
  super
end