public function actionRenderRobots(array $variables = array())
{
$templatePath = '';
$locale = '';
if (!$locale) {
$locale = craft()->language;
}
$metaVars = craft()->seomatic->getGlobals('', $locale);
/* -- Tell Twig not to escape at all for this text template */
$twig = craft()->templates->getTwig();
$escaper = $twig->getExtension('escaper');
$escaper->setDefaultStrategy(false);
if ($templatePath) {
$htmlText = craft()->templates->render($templatePath);
} else {
$oldPath = method_exists(craft()->templates, 'getTemplatesPath') ? craft()->templates->getTemplatesPath() : craft()->path->getTemplatesPath();
$newPath = craft()->path->getPluginsPath() . 'seomatic/templates';
method_exists(craft()->templates, 'setTemplatesPath') ? craft()->templates->setTemplatesPath($newPath) : craft()->path->setTemplatesPath($newPath);
/* -- Render the core template */
$templateName = '_robots';
$this->renderTemplate($templateName, $metaVars);
craft()->path->setTemplatesPath($oldPath);
method_exists(craft()->templates, 'setTemplatesPath') ? craft()->templates->setTemplatesPath($oldPath) : craft()->path->setTemplatesPath($oldPath);
}
}