索引页面的元描述未出现在 laravel 框架中
Meta description for index page not appearing in laravel framework
我有3套URL(索引页、详情页和评论页)。对于详细信息页面和评论页面,元描述出现但不在索引页面中。
@if(strpos(Route::getFacadeRoot()->current()->uri(), 'reviews') !== false && isset($movie_review->description))
<meta name="description" content="{{isset($movie->title)?'Watch '.$movie->title.' online. '.$movie_review->description}}">
@elseif(strpos(Route::getFacadeRoot()->current()->uri(), 'detail') !== false && isset($movie->overview))
<meta name="description" content="{{isset($movie->title)?'Watch '.$movie->title.' online. '.$movie->overview}}"> \
**@elseif(strpos(Route::getFacadeRoot()->current()->uri(), 'index') !== false)
<meta name="description" content="{'This is index page description!'}">**
@endif
将 index
替换为 /
,如下所示:
@elseif(strpos(Route::getFacadeRoot()->current()->uri(), '/') !== false)
<meta name="description" content="This is index page description!">
@endif
我有3套URL(索引页、详情页和评论页)。对于详细信息页面和评论页面,元描述出现但不在索引页面中。
@if(strpos(Route::getFacadeRoot()->current()->uri(), 'reviews') !== false && isset($movie_review->description))
<meta name="description" content="{{isset($movie->title)?'Watch '.$movie->title.' online. '.$movie_review->description}}">
@elseif(strpos(Route::getFacadeRoot()->current()->uri(), 'detail') !== false && isset($movie->overview))
<meta name="description" content="{{isset($movie->title)?'Watch '.$movie->title.' online. '.$movie->overview}}"> \
**@elseif(strpos(Route::getFacadeRoot()->current()->uri(), 'index') !== false)
<meta name="description" content="{'This is index page description!'}">**
@endif
将 index
替换为 /
,如下所示:
@elseif(strpos(Route::getFacadeRoot()->current()->uri(), '/') !== false)
<meta name="description" content="This is index page description!">
@endif