From de3f0afbc70e48ff07398a5004bd8314963600e7 Mon Sep 17 00:00:00 2001 From: filesite Date: Mon, 6 May 2024 13:58:54 +0000 Subject: [PATCH] title update --- plugins/Html.php | 1 + themes/tajian/controller/ListController.php | 6 +----- themes/tajian/controller/SiteController.php | 22 ++++----------------- themes/tajian/views/layout/main.php | 6 +++--- 4 files changed, 9 insertions(+), 26 deletions(-) diff --git a/plugins/Html.php b/plugins/Html.php index 36eefa9..fd179c9 100644 --- a/plugins/Html.php +++ b/plugins/Html.php @@ -75,6 +75,7 @@ Class Html { //生成GA统计代码 public static function getGACode() { + if (!empty(FSC::$app['config']['debug'])) {return '';} $msid = !empty(FSC::$app['config']['GA_MEASUREMENT_ID']) ? FSC::$app['config']['GA_MEASUREMENT_ID'] : ''; if (empty($msid)) {return '';} diff --git a/themes/tajian/controller/ListController.php b/themes/tajian/controller/ListController.php index c0f3346..61a2e0b 100644 --- a/themes/tajian/controller/ListController.php +++ b/themes/tajian/controller/ListController.php @@ -10,7 +10,6 @@ Class ListController extends SiteController { public function actionIndex() { //获取数据 - $menus = array(); //菜单,一级目录 $htmlReadme = ''; //Readme.md 内容,底部网站详细介绍 $htmlCateReadme = ''; //当前目录下的Readme.md 内容 $menus_sorted = array(); //Readme_sort.txt 说明文件内容,一级目录菜单从上到下的排序 @@ -20,9 +19,6 @@ Class ListController extends SiteController { $dirTree = $scanner->scan(__DIR__ . '/../../../www/' . FSC::$app['config']['content_directory'], 3); $scanResults = $scanner->getScanResults(); - //获取目录 - $menus = $scanner->getMenus(); - $titles = array(); $readmeFile = $scanner->getDefaultReadme(); if (!empty($readmeFile)) { @@ -70,7 +66,7 @@ Class ListController extends SiteController { } $viewName = '//site/index'; //共享视图 $params = compact( - 'cateId', 'dirTree', 'scanResults', 'menus', 'htmlReadme', + 'cateId', 'dirTree', 'scanResults', 'htmlReadme', 'breadcrumbs', 'htmlCateReadme', 'tags', 'nickname' ); return $this->render($viewName, $params, $pageTitle); diff --git a/themes/tajian/controller/SiteController.php b/themes/tajian/controller/SiteController.php index 2f29991..39bf18c 100644 --- a/themes/tajian/controller/SiteController.php +++ b/themes/tajian/controller/SiteController.php @@ -26,7 +26,6 @@ Class SiteController extends Controller { //获取数据 $menus = array(); //菜单,一级目录 $htmlReadme = ''; //Readme.md 内容,底部网站详细介绍 - $htmlCateReadme = ''; //当前目录下的Readme.md 内容 $menus_sorted = array(); //Readme_sort.txt 说明文件内容,一级目录菜单从上到下的排序 $scanner = new DirScanner(); @@ -54,17 +53,7 @@ Class SiteController extends Controller { } //默认显示的目录 - $cateId = $this->get('id', $menus[0]['id']); - $subcate = $scanResults[$cateId]; - - //获取当前目录下的readme - $cateReadmeFile = $scanner->getDefaultReadme($cateId); - if (!empty($cateReadmeFile)) { - $Parsedown = new Parsedown(); - $content = file_get_contents($cateReadmeFile['realpath']); - $htmlCateReadme = $Parsedown->text($content); - $htmlCateReadme = $scanner->fixMDUrls($cateReadmeFile['realpath'], $htmlCateReadme); - } + $cateId = $menus[0]['id']; //获取tags分类 $tags = $this->getTags($dirTree); @@ -77,14 +66,11 @@ Class SiteController extends Controller { //昵称支持 $nickname = $this->getNickname($readmeFile); - $pageTitle = $defaultTitle = !empty($titles) ? $titles[0]['name'] : FSC::$app['config']['site_name']; - if (!empty($readmeFile['title'])) { - $pageTitle = "{$readmeFile['title']},来自{$defaultTitle}"; - } + $pageTitle = $defaultTitle = "{$nickname}的视频收藏夹 | " . FSC::$app['config']['site_name']; $viewName = 'index'; $params = compact( - 'cateId', 'dirTree', 'scanResults', 'menus', 'htmlReadme', 'htmlCateReadme', 'tags', + 'cateId', 'dirTree', 'scanResults', 'menus', 'htmlReadme', 'tags', 'nickname' ); return $this->render($viewName, $params, $pageTitle); @@ -222,7 +208,7 @@ Class SiteController extends Controller { //昵称支持 $nickname = $this->getNickname($readmeFile); - $pageTitle = '添加视频收藏'; + $pageTitle = '添加视频收藏 | ' . FSC::$app['config']['site_name']; $viewName = 'new'; $params = compact('dirTree', 'scanResults', 'htmlReadme', 'tags', 'nickname'); return $this->render($viewName, $params, $pageTitle); diff --git a/themes/tajian/views/layout/main.php b/themes/tajian/views/layout/main.php index fe6a639..6037e7f 100644 --- a/themes/tajian/views/layout/main.php +++ b/themes/tajian/views/layout/main.php @@ -45,15 +45,15 @@ if (!empty(FSC::$app['config']['multipleUserUriParse']) && !empty(FSC::$app['use