diff --git a/.DS_Store b/.DS_Store index e33c302..3b15b8a 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/app/Http/Controllers/Front/HomeController.php b/app/Http/Controllers/Front/HomeController.php index 0727109..6da62b5 100644 --- a/app/Http/Controllers/Front/HomeController.php +++ b/app/Http/Controllers/Front/HomeController.php @@ -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'); diff --git a/public/android-chrome-192x192.png b/public/android-chrome-192x192.png new file mode 100644 index 0000000..99eafd3 Binary files /dev/null and b/public/android-chrome-192x192.png differ diff --git a/public/android-chrome-512x512.png b/public/android-chrome-512x512.png new file mode 100644 index 0000000..fcd940e Binary files /dev/null and b/public/android-chrome-512x512.png differ diff --git a/public/apple-touch-icon.png b/public/apple-touch-icon.png new file mode 100644 index 0000000..8bc3b06 Binary files /dev/null and b/public/apple-touch-icon.png differ diff --git a/public/favicon-16x16.png b/public/favicon-16x16.png new file mode 100644 index 0000000..a4260cf Binary files /dev/null and b/public/favicon-16x16.png differ diff --git a/public/favicon-32x32.png b/public/favicon-32x32.png new file mode 100644 index 0000000..1177927 Binary files /dev/null and b/public/favicon-32x32.png differ diff --git a/public/favicon.ico b/public/favicon.ico index e69de29..918d627 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ diff --git a/public/site.webmanifest b/public/site.webmanifest new file mode 100644 index 0000000..45dc8a2 --- /dev/null +++ b/public/site.webmanifest @@ -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"} \ No newline at end of file diff --git a/resources/views/front/country.blade.php b/resources/views/front/country.blade.php index 62563bb..311d71d 100644 --- a/resources/views/front/country.blade.php +++ b/resources/views/front/country.blade.php @@ -11,133 +11,148 @@ -
-
-

Featured Articles

-
- @foreach ($featured_posts as $post) -
+ @if ($featured_posts->count() > 0) +
+
+

Featured Articles

+
+ @foreach ($featured_posts as $post) +
-
- -
-
- - Photo of {{ $post->name }} + - +
-
+
-
- -

- {{ $post->title }} -

-
-
-

- in - @foreach ($post->post_categories as $post_category) - {{ $post_category->category->name }} - - @if (!$loop->last) - , - @endif - @endforeach - {{-- 3 min read --}} -

-
- {{ $post->publish_date->format('j F Y') }} - {{-- 9 min read --}} +

+ {{ $post->title }} +

+
+
+

+ in + @foreach ($post->post_categories as $post_category) + {{ $post_category->category->name }} + + @if (!$loop->last) + , + @endif + @endforeach + {{-- 3 min read --}} +

+
+ {{ $post->publish_date->format('j F Y') }} + {{-- 9 min read --}} +
+
+ @endforeach -
- @endforeach - +
-
-
-
-
-
-

What's New in - {{ get_country_name_by_iso($country_locale->country_iso) }}

-
- @foreach ($latest_posts as $post) -
+ @endif -
-
-
- -
-
- - Photo of {{ $post->name }} + @if (count($latest_posts) > 0) +
+
+
+
+

What's New in + {{ get_country_name_by_iso($country_locale->country_iso) }}

+
+ @foreach ($latest_posts as $post) +
- - Placeholder image of {{ $post->name }} +
+
+ +
+
+ +
+

+ in + @foreach ($post->post_categories as $post_category) + {{ $post_category->category->name }} + + @if (!$loop->last) + , + @endif + @endforeach + {{-- 3 min read --}} +

+ {{ $post->publish_date->format('j F Y') }}
-
- -
-
-
- -
-

- in - @foreach ($post->post_categories as $post_category) - {{ $post_category->category->name }} - - @if (!$loop->last) - , - @endif - @endforeach - {{-- 3 min read --}} -

- {{ $post->publish_date->format('j F Y') }}
-
- @endforeach + @endforeach -
- +
+ @if ($country_locale->country_iso != '*') + All News & Updates + @else + All News & Updates + @endif + +
-
+ @else +
+ Oops! Nothing much here yet. Stay tuned! +
+ @endif @endsection diff --git a/resources/views/layouts/front/app.blade.php b/resources/views/layouts/front/app.blade.php index 98cf249..a30eb07 100644 --- a/resources/views/layouts/front/app.blade.php +++ b/resources/views/layouts/front/app.blade.php @@ -14,6 +14,12 @@ + + + + + + @vite('resources/sass/front-app.scss')