mirror of
https://gitee.com/ulthon/ulthon_information.git
synced 2026-03-03 16:24:28 +08:00
优化页面标题seo
This commit is contained in:
@@ -56,7 +56,7 @@ class Index extends Common
|
||||
|
||||
$model_sub_category = Category::find($sub_category_id);
|
||||
|
||||
$page_title .= "|{$model_sub_category->title}";
|
||||
$page_title .= "-{$model_sub_category->title}";
|
||||
$model_post = Post::hasWhere('categorys', ['category_id' => $sub_category_id])->where('status', 1)->order('id desc');
|
||||
}
|
||||
} else {
|
||||
@@ -71,12 +71,12 @@ class Index extends Common
|
||||
if (!empty($keywords)) {
|
||||
$model_post->whereLike('title|desc|content', "%$keywords%");
|
||||
|
||||
$page_title .= "|{$keywords}";
|
||||
$page_title .= "-{$keywords}";
|
||||
}
|
||||
|
||||
$page = $this->request->param('page', 1);
|
||||
|
||||
$page_title .= "|第{$page}页";
|
||||
$page_title .= "-第{$page}页";
|
||||
|
||||
$list_post = $model_post->paginate([
|
||||
'url' => 'Index/index',
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{$page_title}|{:get_system_config('site_name')}</title>
|
||||
<title>{$page_title}-{:get_system_config('site_name')}</title>
|
||||
<meta name="keywords" content="{:get_system_config('site_keywords')}">
|
||||
<meta name="description" content="{:get_system_config('site_desc')}。{$page_title},{$current_category.desc|default=''}">
|
||||
{include file='common/_require'/}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{$post.title}|{:get_system_config('site_name')}</title>
|
||||
<title>{$post.title}-{:get_system_config('site_name')}</title>
|
||||
<meta name="keywords" content="{:get_system_config('site_keywords')}">
|
||||
<meta name="description" content="{$post.desc|default=$post.title}" />
|
||||
{include file='common/_require'/}
|
||||
|
||||
Reference in New Issue
Block a user