/** * Set Page Meta * ------------- */ function do_meta_1() { $config = Config::get(); $speak = Config::speak(); $html = O_BEGIN . Cell::meta(null, null, array('charset' => $config->charset)) . NL; $html .= Cell::meta('viewport', 'width=device-width', array(), 2) . NL; $html .= Cell::meta('generator', 'Powered by Mecha ' . MECHA_VERSION, array(), 2) . NL; if ($config->page_type !== '404' && isset($config->{$config->page_type}->description)) { $config->description = $config->{$config->page_type}->description; } $html .= Cell::meta('description', Text::parse($config->description, '->text'), array(), 2) . NL; $html .= Cell::meta('author', Text::parse($config->author->name, '->text'), array(), 2) . NL; echo Filter::apply('meta', $html, 1); }
Weapon::add('meta', function () { $config = Config::get(); $speak = Config::speak(); $html = O_BEGIN . Cell::meta(null, null, array('charset' => $config->charset)) . NL; $html .= Cell::meta('viewport', 'width=device-width', array(), 2) . NL; if (isset($config->article->description)) { $description = strip_tags($config->article->description); } else { if (isset($config->page->description)) { $description = strip_tags($config->page->description); } else { $description = strip_tags($config->description); } } $html .= Cell::meta('description', $description, array(), 2) . NL; $html .= Cell::meta('author', strip_tags($config->author), array(), 2) . NL; echo Filter::apply('meta', $html, 1); }, 10); Weapon::add('meta', function () { $config = Config::get(); $html = Cell::title(strip_tags($config->page_title), array(), 2) . NL; $html .= Cell::_('[if IE]>' . Cell::script($config->protocol . 'html5shiv.googlecode.com/svn/trunk/html5.js') . '<![endif]', 2, "") . NL; echo Filter::apply('meta', $html, 2); }, 20); Weapon::add('meta', function () { $config = Config::get(); $speak = Config::speak(); $html = Cell::link($config->url . '/favicon.ico', 'shortcut icon', 'image/x-icon', array(), 2) . NL; $html .= Cell::link($config->url_current, 'canonical', null, array(), 2) . NL; $html .= Cell::link($config->url . '/sitemap', 'sitemap', null, array(), 2) . NL; $html .= Cell::link($config->url . '/feed/rss', 'alternate', 'application/rss+xml', array('title' => $speak->feeds . $config->title_separator . $config->title), 2) . O_END;