diff --git a/src/Controller/MainController.php b/src/Controller/MainController.php index 0463039..1e6e75a 100644 --- a/src/Controller/MainController.php +++ b/src/Controller/MainController.php @@ -38,8 +38,7 @@ final class MainController extends AbstractController ); $fs = new Filesystem(); - if (!$fs->exists($fullPath)) throw $this->createNotFoundException(); - $contents = $fs->readFile($fullPath); + $contents = $fs->exists($fullPath) ? $fs->readFile($fullPath) : null; // -------------------------------------------------- Get data tree --- diff --git a/templates/main/index.html.twig b/templates/main/index.html.twig index f96d3b7..7632d10 100644 --- a/templates/main/index.html.twig +++ b/templates/main/index.html.twig @@ -26,7 +26,11 @@ {{ _self.render_tree(tree) }}
+ {% if contents is not null %} {{ contents|markdown_to_html }} + {% else %} + Empty + {% endif %}