 bundledPlugins = null
 # Regexp for matching post filenames
 postMask = null
+# Global reference for custom tags
+currentState = null
 
 INCLUDE_PATH = '_includes'
 

    categories: {}
  }

  # Add all values from config, but make sure not to clobber any existing
  for key, value of config
    unless key of site

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

  currentState.page = page

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