Browse Source

add introduction and contact

master
filesite 3 years ago
parent
commit
6092c11800
  1. 14
      themes/pagedirectory/controller/SiteController.php
  2. 10
      themes/pagedirectory/views/layout/main.php
  3. 9
      www/css/pagedirectory.css

14
themes/pagedirectory/controller/SiteController.php

@ -9,9 +9,10 @@ Class SiteController extends Controller {
public function actionIndex() { public function actionIndex() {
//获取数据 //获取数据
$menus = []; $menus = []; //菜单,一级目录
$menus_sorted = []; $htmlReadme = ''; //Readme.md 内容,底部网站详细介绍
$htmlReadme = ''; $htmlContact = ''; //Readme_contact.txt 说明文件内容,右侧悬浮菜单里的“联系我”
$menus_sorted = []; //Readme_sort.txt 说明文件内容,一级目录菜单从上到下的排序
$titles = []; $titles = [];
$content = ''; $content = '';
@ -34,6 +35,11 @@ Class SiteController extends Controller {
$Parsedown = new Parsedown(); $Parsedown = new Parsedown();
$htmlReadme = $Parsedown->text($content); $htmlReadme = $Parsedown->text($content);
$htmlReadme = $scanner->fixMDUrls($readmeFile['realpath'], $htmlReadme); $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开源系统"; $pageTitle = !empty($titles) ? $titles[0]['name'] : "FileSite.io - 无数据库、基于文件和目录的Markdown文档、网址导航、图书、图片、视频网站PHP开源系统";
$viewName = 'index'; $viewName = 'index';
$params = compact('dirTree', 'menus', 'htmlReadme'); $params = compact('dirTree', 'menus', 'htmlReadme', 'htmlContact');
return $this->render($viewName, $params, $pageTitle); return $this->render($viewName, $params, $pageTitle);
} }

10
themes/pagedirectory/views/layout/main.php

@ -41,11 +41,19 @@ include_once $viewFile;
</div> </div>
<div class="hr"></div> <div class="hr"></div>
<div class="modal-body markdown-body"> <div class="modal-body markdown-body">
<?php echo !empty($viewData['htmlReadme']) ? $viewData['htmlReadme'] : ''; ?> <?php echo !empty($viewData['htmlContact']) ? $viewData['htmlContact'] : ''; ?>
</div> </div>
</div> </div>
</div> </div>
<?php if (!empty($viewData['htmlReadme'])) {
echo <<<eof
<div class="introduction markdown-body">
{$viewData['htmlReadme']}
</div>
eof;
} ?>
<div class="footer"> <div class="footer">
<?php if (!empty(FSC::$app['config']['theme'])) { ?> <?php if (!empty(FSC::$app['config']['theme'])) { ?>
Theme name <strong><?php echo FSC::$app['config']['theme']; ?></strong> Theme name <strong><?php echo FSC::$app['config']['theme']; ?></strong>

9
www/css/pagedirectory.css

@ -4,9 +4,6 @@ a{color: #aaadb2;text-decoration: none}
.header{padding:10px 10px 0 10px;position: relative;} .header{padding:10px 10px 0 10px;position: relative;}
.header .logo{display: inline-block;margin:10px 10px 6px 10px;font-size: 1.86em;color: #e8eaed} .header .logo{display: inline-block;margin:10px 10px 6px 10px;font-size: 1.86em;color: #e8eaed}
.header .logo img{vertical-align: middle;} .header .logo img{vertical-align: middle;}
.menu{max-width: 80%;white-space: nowrap;overflow-x:auto;overflow-y: hidden;margin: 0 auto;}
.menu a{display: inline-block;line-height: 16px;margin: 0 1px;padding: 16px 12px 12px 10px;text-align: center}
.menu .selected{color: #8ab4f8;border-bottom: 3px solid #8ab4f8;padding: 20px 12px 11px 10px;}
.indexes{position:fixed;min-width:68px;top: 80px;left: 4px;bottom: 100px;background-color: #2b2c2e;padding: 5px 5px 10px 5px;border-radius: 5px;max-height:500px;overflow-y: auto;} .indexes{position:fixed;min-width:68px;top: 80px;left: 4px;bottom: 100px;background-color: #2b2c2e;padding: 5px 5px 10px 5px;border-radius: 5px;max-height:500px;overflow-y: auto;}
.indexes a{display: block;line-height: 2;font-size: 16px;font-weight: 500;} .indexes a{display: block;line-height: 2;font-size: 16px;font-weight: 500;}
.hr{border-bottom: solid 1px #3c4043;margin-bottom: 11px} .hr{border-bottom: solid 1px #3c4043;margin-bottom: 11px}
@ -23,11 +20,7 @@ a{color: #aaadb2;text-decoration: none}
.modal-about .modal-body h1{display: none;} .modal-about .modal-body h1{display: none;}
.breadcrumbs{padding-left: 1.5em;padding-bottom: 10px;} .breadcrumbs{padding-left: 1.5em;padding-bottom: 10px;}
.content{padding: 20px 10px;padding-left: 90px} .content{padding: 20px 10px;padding-left: 90px}
.img-item{display: inline-block;margin-left: 10px;margin-right: 10px;margin-bottom: 20px;cursor: pointer;} .introduction{padding: 0 0 20px 90px}
.img-item img{height: 180px;object-fit: cover;}
.img-item strong{display: block;color: #bdc1c6;font-family: Roboto,Arial,sans-serif;font-size: 12px;letter-spacing: .2px;line-height: 20px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;}
.catedesc{padding: 0 10px}
.cateinfo{margin-bottom: 1em;padding: 5px 10px 10px 10px}
.clearfix::after {content: "";clear: both;display: table;} .clearfix::after {content: "";clear: both;display: table;}
.url-group{margin-bottom: 10px} .url-group{margin-bottom: 10px}
.url-group h3{margin-top: 0} .url-group h3{margin-top: 0}

Loading…
Cancel
Save