From c44ddfaaea9a1b6eed60273f23f13cc182c9b1ea Mon Sep 17 00:00:00 2001 From: Lex Lim Date: Tue, 31 May 2022 14:51:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0seo=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Seo.php | 24 +----------------------- src/views/index.php | 2 ++ src/views/thread.php | 2 ++ 3 files changed, 5 insertions(+), 23 deletions(-) diff --git a/src/Seo.php b/src/Seo.php index 5f36790..fc8b0b1 100644 --- a/src/Seo.php +++ b/src/Seo.php @@ -86,7 +86,7 @@ class Seo { self::route('/', [$this, 'beforePageIndex'], [$this, 'afterPageIndex'], 300); // 帖子页面 - self::route('/thread/@threadId', [$this, 'beforePageThread'], [$this, 'afterPageThread'], 300); + self::route('/thread/@threadId:[0-9]+', [$this, 'beforePageThread'], [$this, 'afterPageThread'], 300); } public function beforePageIndex() { @@ -151,18 +151,7 @@ class Seo { $dom->setOptions($options); $dom->loadStr($outputPage); - // 增加css - $appendDom = new Dom(); - $appendDom->setOptions($options); - $appendDom->loadStr(<< - - HTML); - $headElem = $dom->find('head'); - foreach($appendDom->getChildren() as $child) { - $headElem->addChild($child); - } // 更改标题 if ($data['currentCategory']['isIndex']) { @@ -255,18 +244,7 @@ class Seo { $dom->setOptions($options); $dom->loadStr($outputPage); - // 增加css - $appendDom = new Dom(); - $appendDom->setOptions($options); - $appendDom->loadStr(<< - - HTML); - $headElem = $dom->find('head'); - foreach($appendDom->getChildren() as $child) { - $headElem->addChild($child); - } // 增加author $authorMeta = new HtmlNode('meta'); diff --git a/src/views/index.php b/src/views/index.php index 27c9fb5..75476e8 100644 --- a/src/views/index.php +++ b/src/views/index.php @@ -1,3 +1,5 @@ + +