Update (layout): add favicon, improve home pages, add noindex if page is empty
@@ -63,6 +63,10 @@ public function country(Request $request, $country)
|
|||||||
->take(10)
|
->take(10)
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
|
if ($latest_posts->count() <= 0) {
|
||||||
|
SEOMeta::setRobots('noindex');
|
||||||
|
}
|
||||||
|
|
||||||
SEOTools::metatags();
|
SEOTools::metatags();
|
||||||
SEOTools::twitter();
|
SEOTools::twitter();
|
||||||
SEOTools::opengraph();
|
SEOTools::opengraph();
|
||||||
@@ -94,6 +98,8 @@ public function countryCategory(Request $request, $country, $category)
|
|||||||
abort(404);
|
abort(404);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$request->session()->put('view_country_locale', $country_locale);
|
||||||
|
|
||||||
$latest_posts = Post::with('post_categories')->select('posts.*')
|
$latest_posts = Post::with('post_categories')->select('posts.*')
|
||||||
->join('post_categories', 'posts.id', '=', 'post_categories.post_id')
|
->join('post_categories', 'posts.id', '=', 'post_categories.post_id')
|
||||||
->join('categories', 'post_categories.category_id', '=', 'categories.id')
|
->join('categories', 'post_categories.category_id', '=', 'categories.id')
|
||||||
@@ -106,6 +112,10 @@ public function countryCategory(Request $request, $country, $category)
|
|||||||
->distinct()
|
->distinct()
|
||||||
->paginate(15);
|
->paginate(15);
|
||||||
|
|
||||||
|
if ($latest_posts->count() <= 0) {
|
||||||
|
SEOMeta::setRobots('noindex');
|
||||||
|
}
|
||||||
|
|
||||||
SEOTools::metatags();
|
SEOTools::metatags();
|
||||||
SEOTools::twitter();
|
SEOTools::twitter();
|
||||||
SEOTools::opengraph();
|
SEOTools::opengraph();
|
||||||
@@ -126,6 +136,8 @@ public function all(Request $request, $country)
|
|||||||
{
|
{
|
||||||
$country_locale = CountryLocale::where('slug', $country)->first();
|
$country_locale = CountryLocale::where('slug', $country)->first();
|
||||||
|
|
||||||
|
$request->session()->put('view_country_locale', $country_locale);
|
||||||
|
|
||||||
$latest_posts = Post::with('post_categories')->select('posts.*')
|
$latest_posts = Post::with('post_categories')->select('posts.*')
|
||||||
->join('post_categories', 'posts.id', '=', 'post_categories.post_id')
|
->join('post_categories', 'posts.id', '=', 'post_categories.post_id')
|
||||||
->join('categories', 'post_categories.category_id', '=', 'categories.id')
|
->join('categories', 'post_categories.category_id', '=', 'categories.id')
|
||||||
@@ -137,6 +149,10 @@ public function all(Request $request, $country)
|
|||||||
->distinct()
|
->distinct()
|
||||||
->paginate(15);
|
->paginate(15);
|
||||||
|
|
||||||
|
if ($latest_posts->count() <= 0) {
|
||||||
|
SEOMeta::setRobots('noindex');
|
||||||
|
}
|
||||||
|
|
||||||
SEOTools::metatags();
|
SEOTools::metatags();
|
||||||
SEOTools::twitter();
|
SEOTools::twitter();
|
||||||
SEOTools::opengraph();
|
SEOTools::opengraph();
|
||||||
@@ -157,6 +173,8 @@ public function post(Request $request, $country, $post_slug)
|
|||||||
|
|
||||||
if (! is_null($post)) {
|
if (! is_null($post)) {
|
||||||
|
|
||||||
|
$request->session()->put('view_country_locale', $post->post_category->category->country_locale);
|
||||||
|
|
||||||
SEOMeta::setTitle($post->title);
|
SEOMeta::setTitle($post->title);
|
||||||
SEOMeta::setDescription($post->excerpt);
|
SEOMeta::setDescription($post->excerpt);
|
||||||
SEOMeta::addMeta('article:published_time', $post->publish_date, 'property');
|
SEOMeta::addMeta('article:published_time', $post->publish_date, 'property');
|
||||||
|
|||||||
BIN
public/android-chrome-192x192.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
public/android-chrome-512x512.png
Normal file
|
After Width: | Height: | Size: 106 KiB |
BIN
public/apple-touch-icon.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
public/favicon-16x16.png
Normal file
|
After Width: | Height: | Size: 630 B |
BIN
public/favicon-32x32.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 0 B After Width: | Height: | Size: 15 KiB |
1
public/site.webmanifest
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}
|
||||||
@@ -11,6 +11,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@if ($featured_posts->count() > 0)
|
||||||
<div class="container-fluid py-4 bg-dark text-light">
|
<div class="container-fluid py-4 bg-dark text-light">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h3 class="h4 fw-bold text-center mb-3">Featured Articles</h3>
|
<h3 class="h4 fw-bold text-center mb-3">Featured Articles</h3>
|
||||||
@@ -71,6 +72,9 @@ class="text-body-secondary">{{ $post->publish_date->format('j F Y') }}</small>
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if (count($latest_posts) > 0)
|
||||||
<div class="container-fluid py-4">
|
<div class="container-fluid py-4">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row justify-content-center">
|
<div class="row justify-content-center">
|
||||||
@@ -133,11 +137,22 @@ class="text-body-secondary">{{ $post->publish_date->format('j F Y') }}</small>
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="text-center py-3">
|
<div class="text-center py-3">
|
||||||
|
@if ($country_locale->country_iso != '*')
|
||||||
<a href="{{ route('home.country.posts', ['country' => $country_locale->country_iso]) }}"
|
<a href="{{ route('home.country.posts', ['country' => $country_locale->country_iso]) }}"
|
||||||
class="btn btn-primary">All News & Updates</a>
|
class="btn btn-primary">All News & Updates</a>
|
||||||
|
@else
|
||||||
|
<a href="{{ route('home.country.posts', ['country' => 'world']) }}"
|
||||||
|
class="btn btn-primary">All News & Updates</a>
|
||||||
|
@endif
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@else
|
||||||
|
<div class="container text-center pb-5">
|
||||||
|
Oops! Nothing much here yet. Stay tuned!
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
@endsection
|
@endsection
|
||||||
|
|||||||
@@ -14,6 +14,12 @@
|
|||||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||||
|
|
||||||
|
|
||||||
|
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
||||||
|
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png">
|
||||||
|
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png">
|
||||||
|
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png">
|
||||||
|
<link rel="manifest" href="site.webmanifest">
|
||||||
|
|
||||||
@vite('resources/sass/front-app.scss')
|
@vite('resources/sass/front-app.scss')
|
||||||
|
|
||||||
<!-- Custom styles for this Page-->
|
<!-- Custom styles for this Page-->
|
||||||
|
|||||||