         if Config.DEV || !meta.draft
           if meta.permalink == Config.index
             Logger.debug "  index: #{meta.permalink}"
-            Builder.render( thing, kind, 'index.html' )
+            Builder.render( meta.thing, kind, 'index.html' )
           Logger.debug( "  #{kind}: #{meta.permalink}" )
-          Builder.render thing, kind
+          Builder.render meta.thing, kind
         else
           Logger.debug( "  skipped: #{thing}" )
     process = ( kind ) ->

  Logger.config Config

Builder.render = ( path, kind, pathOverride=null ) ->
  meta = _.clone( global["#{kind.toUpperCase()}_INFO"][path] )
  dir = "#{CWD}/build/#{meta.permalink}"
  mkdir_p dir, 0777, ( err ) ->
    if err

      { strftime: strftime }
    )

    try
      meta.processed = ejs.render meta.src, locals: meta
      meta.content = md( meta.processed )
    catch e
      Logger.error "Could not process file: #{meta.permalink} - #{e}"
      return

    fs.readFile "#{CWD}/_inc/layout.jade", ( err, layout ) ->
      tmpl = jade.compile layout.toString(), meta
