     front_matter_string = @file_contents.match(yaml_matcher)
 
     if front_matter_string
-      @template_name = "#{path.basename(@file, path.extname(@file))}"
-      options.locals.site = {}
-      # this should add to an array
-      options.locals.site[@template_name] = {}
+      # set up variables
+      options.locals.site = []
+      @dynamic_locals = {}
+
       front_matter = js_yaml.safeLoad(front_matter_string[1], { filename: @file })
-
-      options.locals.site[@template_name][k] = v for k,v of front_matter
+      @dynamic_locals[k] = v for k,v of front_matter
+  
       @layout = front_matter.layout if _.pluck(front_matter, 'layout')
       @file_contents = @file_contents.replace yaml_matcher, ''
 

    write_content = @compress(write_content) if options.compress
    fs.writeFileSync @export_path, write_content
    global.options.debug.log "compiled #{path.basename(@file)}"

  compress: (write_content) ->
    require('../utils/compressor')(write_content, @target_extension)

    for key, value of extra
      options.locals[key] = value

    # add compiled content to locals for dynamic templates
    if @dynamic_locals and extra? and extra.yield?
      @dynamic_locals.content = extra.yield.trim()
      options.locals.site.push(@dynamic_locals)

    return options.locals

