Update (layout): add favicon, improve home pages, add noindex if page is empty
This commit is contained in:
@@ -63,6 +63,10 @@ public function country(Request $request, $country)
|
||||
->take(10)
|
||||
->get();
|
||||
|
||||
if ($latest_posts->count() <= 0) {
|
||||
SEOMeta::setRobots('noindex');
|
||||
}
|
||||
|
||||
SEOTools::metatags();
|
||||
SEOTools::twitter();
|
||||
SEOTools::opengraph();
|
||||
@@ -94,6 +98,8 @@ public function countryCategory(Request $request, $country, $category)
|
||||
abort(404);
|
||||
}
|
||||
|
||||
$request->session()->put('view_country_locale', $country_locale);
|
||||
|
||||
$latest_posts = Post::with('post_categories')->select('posts.*')
|
||||
->join('post_categories', 'posts.id', '=', 'post_categories.post_id')
|
||||
->join('categories', 'post_categories.category_id', '=', 'categories.id')
|
||||
@@ -106,6 +112,10 @@ public function countryCategory(Request $request, $country, $category)
|
||||
->distinct()
|
||||
->paginate(15);
|
||||
|
||||
if ($latest_posts->count() <= 0) {
|
||||
SEOMeta::setRobots('noindex');
|
||||
}
|
||||
|
||||
SEOTools::metatags();
|
||||
SEOTools::twitter();
|
||||
SEOTools::opengraph();
|
||||
@@ -126,6 +136,8 @@ public function all(Request $request, $country)
|
||||
{
|
||||
$country_locale = CountryLocale::where('slug', $country)->first();
|
||||
|
||||
$request->session()->put('view_country_locale', $country_locale);
|
||||
|
||||
$latest_posts = Post::with('post_categories')->select('posts.*')
|
||||
->join('post_categories', 'posts.id', '=', 'post_categories.post_id')
|
||||
->join('categories', 'post_categories.category_id', '=', 'categories.id')
|
||||
@@ -137,6 +149,10 @@ public function all(Request $request, $country)
|
||||
->distinct()
|
||||
->paginate(15);
|
||||
|
||||
if ($latest_posts->count() <= 0) {
|
||||
SEOMeta::setRobots('noindex');
|
||||
}
|
||||
|
||||
SEOTools::metatags();
|
||||
SEOTools::twitter();
|
||||
SEOTools::opengraph();
|
||||
@@ -157,6 +173,8 @@ public function post(Request $request, $country, $post_slug)
|
||||
|
||||
if (! is_null($post)) {
|
||||
|
||||
$request->session()->put('view_country_locale', $post->post_category->category->country_locale);
|
||||
|
||||
SEOMeta::setTitle($post->title);
|
||||
SEOMeta::setDescription($post->excerpt);
|
||||
SEOMeta::addMeta('article:published_time', $post->publish_date, 'property');
|
||||
|
||||
Reference in New Issue
Block a user