setWebRoot(FSC::$app['config']['content_directory']); $dirTree = $scanner->scan(__DIR__ . '/../../../www/' . FSC::$app['config']['content_directory'], 4); $readmeFile = $scanner->getDefaultReadme(); $menus = $scanner->getMenus(); if (!empty($readmeFile)) { $titles = $scanner->getMDTitles($readmeFile['id']); $content = file_get_contents($readmeFile['realpath']); $Parsedown = new Parsedown(); $htmlReadme = $Parsedown->text($content); $htmlReadme = $scanner->fixMDUrls($readmeFile['realpath'], $htmlReadme); } $pageTitle = !empty($titles) ? $titles[0]['name'] : "FileSite.io - 无数据库、基于文件和目录的Markdown文档、网址导航、图书、图片、视频网站PHP开源系统"; $viewName = 'index'; $params = compact('dirTree', 'menus', 'htmlReadme'); return $this->render($viewName, $params, $pageTitle); } }