Skip to content

Commit e8cdaf8

Browse files
author
fengr06
committed
seo
1 parent 56eb86f commit e8cdaf8

13 files changed

Lines changed: 82 additions & 188363 deletions

File tree

app/Http/Controllers/ArticleController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function show(Request $request, $id)
103103
$count = $article->comments()->count();
104104
$article->words = mb_strlen(strip_tags($article->content_html), 'UTF8');
105105
$article->read = ceil($article->words / 1000);
106-
106+
$article->description = mb_substr($this->formatContent($this->cutstr_html($article->content_html)), 0, 80, 'utf-8');
107107
if ($article->cate_id) {
108108
$article->cates = Cate::where('id', $article->cate_id)->first()->name;
109109
}
@@ -167,6 +167,7 @@ public function show(Request $request, $id)
167167

168168
$article->content_html = $content;
169169
$tags = $article->tags;
170+
$article->keywords = implode(',', array_column($tags->toArray(), 'name'));
170171
return view(env('BLOG_THEME') . '.articles.show', compact('article', 'comments', 'input', 'count', 'outline', 'tags', 'articleCount', 'catesCount', 'tagsCount', 'preArticle', 'bacArticle'));
171172
}
172173

0 commit comments

Comments
 (0)