basename($filePath, '.md'), glob('./scores/*.md') ); if (!$scoreValid) { echo $twig->render('index.html.twig', ['scores' => $allAvailableScores, 'title' => 'Available Scores']); exit(0); } $markdown = file_get_contents($score); $parsedown = new Parsedown(); $html = $parsedown->text($markdown); echo $twig->render('score.html.twig', [ 'score' => $html, 'scores' => $allAvailableScores, 'title' => basename($score, '.md'), ]);