From c141cf3139f7c6d245d0b7c65a5943253f07a591 Mon Sep 17 00:00:00 2001 From: filesite Date: Mon, 15 Jul 2024 13:37:19 +0800 Subject: [PATCH] improve page title in list page --- themes/beauty/controller/ListController.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/themes/beauty/controller/ListController.php b/themes/beauty/controller/ListController.php index cfbb852..0b55d68 100644 --- a/themes/beauty/controller/ListController.php +++ b/themes/beauty/controller/ListController.php @@ -91,9 +91,9 @@ Class ListController extends Controller { //获取根目录下的readme $cacheKey = $this->getCacheKey('root', 'readme', $maxScanDeep); - $cachedData = Common::getCacheFromFile($cacheKey); - if (!empty($cachedData)) { - $htmlReadme = $cachedData['htmlReadme']; + $readmeFile = Common::getCacheFromFile($cacheKey); + if (!empty($readmeFile)) { + $htmlReadme = $readmeFile['htmlReadme']; } @@ -121,18 +121,13 @@ Class ListController extends Controller { $pageSize = $this->get('limit', 24); - //获取网站名称和版权申明 - $maxScanDeep = 0; //最大扫描目录级数 - $cacheKey = $this->getCacheKey('root', 'readme', $maxScanDeep); - $readmeFile = Common::getCacheFromFile($cacheKey); - //底部版权申明配置支持 $copyright = ''; if (!empty($readmeFile['copyright'])) { $copyright = $readmeFile['copyright']; } - $pageTitle = !empty($titles) ? $titles[0]['name'] : "FileSite.io"; + $pageTitle = !empty($readmeFile['titles']) ? $readmeFile['titles'][0]['name']: $currentDir['directory']; if (!empty($readmeFile['title'])) { $pageTitle = $readmeFile['title']; }