 bundledPlugins = null
 # Regexp for matching post filenames
 postMask = null
-# Global handle for current content being converted
-currentState = null
 
 INCLUDE_PATH = '_includes'
 
 module.exports = exports = (config, callback) ->
-  log.info
+  log.info "generate", "Begin generation"
   # First-run initialization
   postMask = ///^(\d{4})-(\d{2})-(\d{2})-(.+)\.(#{config.markdown_ext.join '|'}|html)$///
   time.tzset config.timezone


writePage = (page, bundle, callback) ->
  log.verbose "generate", "writePage %s", page.url
  { site, config, liquidOptions, compiledLayouts, mergedPlugins } = bundle

  # Respect published file
  return callback() unless config.future or page.published

  # Prepare plugins
  mergedPlugins = mergePlugins bundledPlugins, plugins

  liquidOptions =
    tags: mergedPlugins.tags

  # Create base context for tinyliquid
  context = tinyliquid.newContext {
    locals: {
      site
    }
    filters: mergedPlugins.filters
  }

  # Handle {% include %} tags
  context.onInclude (name, callback) ->
    log.silly "generate", "Fetching include for %s", name
    ast = tinyliquid.compile includes[name], liquidOptions
    callback null, ast

  # Compile layouts
  compiledLayouts = {}
