public static function routeMarkdown() { if ($filename = static::findFileForRoute(Route::requestUri(), Conf::get('glueExtras/RouteTools/content/path'), array('md'))) { $parser = new Parser(); if (!($document = $parser->parse(file_get_contents($filename)))) { echo "<div><strong>Error:</strong> Failed to parse markdown/front-YAML</div>"; return; } Route::any(Route::requestUri(), function () use($document) { Template::setMulti($document->getYAML()); echo $document->getContent(); }); } }