From 6092c118005283b5453491fad929ac519f92621f Mon Sep 17 00:00:00 2001 From: filesite Date: Fri, 20 May 2022 07:26:51 +0800 Subject: [PATCH] add introduction and contact --- themes/pagedirectory/controller/SiteController.php | 14 ++++++++++---- themes/pagedirectory/views/layout/main.php | 10 +++++++++- www/css/pagedirectory.css | 9 +-------- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/themes/pagedirectory/controller/SiteController.php b/themes/pagedirectory/controller/SiteController.php index 40cd6a2..126c9ec 100644 --- a/themes/pagedirectory/controller/SiteController.php +++ b/themes/pagedirectory/controller/SiteController.php @@ -9,9 +9,10 @@ Class SiteController extends Controller { public function actionIndex() { //获取数据 - $menus = []; - $menus_sorted = []; - $htmlReadme = ''; + $menus = []; //菜单,一级目录 + $htmlReadme = ''; //Readme.md 内容,底部网站详细介绍 + $htmlContact = ''; //Readme_contact.txt 说明文件内容,右侧悬浮菜单里的“联系我” + $menus_sorted = []; //Readme_sort.txt 说明文件内容,一级目录菜单从上到下的排序 $titles = []; $content = ''; @@ -34,6 +35,11 @@ Class SiteController extends Controller { $Parsedown = new Parsedown(); $htmlReadme = $Parsedown->text($content); $htmlReadme = $scanner->fixMDUrls($readmeFile['realpath'], $htmlReadme); + + if (!empty($readmeFile['contact'])) { + $htmlContact = $Parsedown->text($readmeFile['contact']); + $htmlContact = $scanner->fixMDUrls($readmeFile['realpath'], $htmlContact); + } } //排序 @@ -74,7 +80,7 @@ Class SiteController extends Controller { $pageTitle = !empty($titles) ? $titles[0]['name'] : "FileSite.io - 无数据库、基于文件和目录的Markdown文档、网址导航、图书、图片、视频网站PHP开源系统"; $viewName = 'index'; - $params = compact('dirTree', 'menus', 'htmlReadme'); + $params = compact('dirTree', 'menus', 'htmlReadme', 'htmlContact'); return $this->render($viewName, $params, $pageTitle); } diff --git a/themes/pagedirectory/views/layout/main.php b/themes/pagedirectory/views/layout/main.php index 1124264..d96c8e8 100644 --- a/themes/pagedirectory/views/layout/main.php +++ b/themes/pagedirectory/views/layout/main.php @@ -41,11 +41,19 @@ include_once $viewFile;
+ + {$viewData['htmlReadme']} + +eof; + } ?> +