瀏覽代碼

Set order in canonical addresses

Visman 2 年之前
父節點
當前提交
fcee58adea
共有 5 個文件被更改,包括 6 次插入3 次删除
  1. 2 0
      app/Models/Pages/Auth.php
  2. 1 1
      app/Models/Pages/Delete.php
  3. 1 1
      app/Models/Pages/Edit.php
  4. 1 0
      app/Models/Pages/Rules.php
  5. 1 1
      app/Models/Pages/Search.php

+ 2 - 0
app/Models/Pages/Auth.php

@@ -120,6 +120,7 @@ class Auth extends Page
         $this->nameTpl      = 'login';
         $this->nameTpl      = 'login';
         $this->onlinePos    = 'login';
         $this->onlinePos    = 'login';
         $this->onlineDetail = null;
         $this->onlineDetail = null;
+        $this->canonical    = $this->c->Router->link('Login');
         $this->robots       = 'noindex';
         $this->robots       = 'noindex';
         $this->titles       = 'Login';
         $this->titles       = 'Login';
         $this->regLink      = 1 === $this->c->config->b_regs_allow ? $this->c->Router->link('Register') : null;
         $this->regLink      = 1 === $this->c->config->b_regs_allow ? $this->c->Router->link('Register') : null;
@@ -363,6 +364,7 @@ class Auth extends Page
         $this->nameTpl      = 'passphrase_reset';
         $this->nameTpl      = 'passphrase_reset';
         $this->onlinePos    = 'passphrase_reset';
         $this->onlinePos    = 'passphrase_reset';
         $this->onlineDetail = null;
         $this->onlineDetail = null;
+        $this->canonical    = $this->c->Router->link('Forget');
         $this->robots       = 'noindex';
         $this->robots       = 'noindex';
         $this->titles       = 'Passphrase reset';
         $this->titles       = 'Passphrase reset';
         $this->form         = $this->formForget($v->email ?? $email);
         $this->form         = $this->formForget($v->email ?? $email);

+ 1 - 1
app/Models/Pages/Delete.php

@@ -72,7 +72,7 @@ class Delete extends Page
 
 
         $this->nameTpl    = 'post';
         $this->nameTpl    = 'post';
         $this->onlinePos  = 'topic-' . $topic->id;
         $this->onlinePos  = 'topic-' . $topic->id;
-        $this->canonical  = $post->linkDelete;
+//        $this->canonical  = $post->linkDelete;
         $this->robots     = 'noindex';
         $this->robots     = 'noindex';
         $this->formTitle  = $deleteTopic ? 'Delete topic' : 'Delete post';
         $this->formTitle  = $deleteTopic ? 'Delete topic' : 'Delete post';
         $this->crumbs     = $this->crumbs($this->formTitle, $topic);
         $this->crumbs     = $this->crumbs($this->formTitle, $topic);

+ 1 - 1
app/Models/Pages/Edit.php

@@ -129,7 +129,7 @@ class Edit extends Page
 
 
         $this->nameTpl   = 'post';
         $this->nameTpl   = 'post';
         $this->onlinePos = 'topic-' . $topic->id;
         $this->onlinePos = 'topic-' . $topic->id;
-        $this->canonical = $post->linkEdit;
+//        $this->canonical = $post->linkEdit;
         $this->robots    = 'noindex';
         $this->robots    = 'noindex';
         $this->formTitle = $firstPost ? 'Edit topic' : 'Edit post';
         $this->formTitle = $firstPost ? 'Edit topic' : 'Edit post';
         $this->crumbs    = $this->crumbs($this->formTitle, $topic);
         $this->crumbs    = $this->crumbs($this->formTitle, $topic);

+ 1 - 0
app/Models/Pages/Rules.php

@@ -47,6 +47,7 @@ class Rules extends Page
         $this->nameTpl      = 'rules';
         $this->nameTpl      = 'rules';
         $this->onlinePos    = 'rules';
         $this->onlinePos    = 'rules';
         $this->onlineDetail = null;
         $this->onlineDetail = null;
+        $this->canonical    = $this->c->Router->link('Register');
         $this->robots       = 'noindex';
         $this->robots       = 'noindex';
         $this->crumbs       = $this->crumbs(
         $this->crumbs       = $this->crumbs(
             'Forum rules',
             'Forum rules',

+ 1 - 1
app/Models/Pages/Search.php

@@ -143,7 +143,7 @@ class Search extends Page
         $this->nameTpl      = 'search';
         $this->nameTpl      = 'search';
         $this->onlinePos    = 'search';
         $this->onlinePos    = 'search';
         $this->onlineDetail = null;
         $this->onlineDetail = null;
-        $this->canonical    = $this->c->Router->link('Search');
+        $this->canonical    = $this->c->Router->link($advanced ? 'SearchAdvanced' : 'Search');
         $this->robots       = 'noindex';
         $this->robots       = 'noindex';
         $this->form         = $advanced ? $this->formSearchAdvanced($v) : $this->formSearch($v);
         $this->form         = $advanced ? $this->formSearchAdvanced($v) : $this->formSearch($v);
         $this->crumbs       = $this->crumbs();
         $this->crumbs       = $this->crumbs();