Update (seo)
Add (lqip)
This commit is contained in:
@@ -5,12 +5,22 @@
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Category;
|
||||
use App\Models\Post;
|
||||
use Artesaos\SEOTools\Facades\SEOTools;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class FrontListController extends Controller
|
||||
{
|
||||
public function index(Request $request)
|
||||
{
|
||||
|
||||
$title = 'Latest News from EchoScoop';
|
||||
|
||||
SEOTools::metatags();
|
||||
SEOTools::twitter();
|
||||
SEOTools::opengraph();
|
||||
SEOTools::jsonLd();
|
||||
SEOTools::setTitle($title, false);
|
||||
|
||||
$posts = Post::where('status', 'publish')->orderBy('published_at', 'desc')->simplePaginate(10) ?? collect();
|
||||
|
||||
return view('front.post_list', compact('posts'));
|
||||
@@ -22,6 +32,14 @@ public function category(Request $request, $category_slug)
|
||||
|
||||
$posts = $category?->posts()->where('status', 'publish')->orderBy('published_at', 'desc')->simplePaginate(10) ?? collect();
|
||||
|
||||
$title = $category->name.' News from EchoScoop';
|
||||
|
||||
SEOTools::metatags();
|
||||
SEOTools::twitter();
|
||||
SEOTools::opengraph();
|
||||
SEOTools::jsonLd();
|
||||
SEOTools::setTitle($title, false);
|
||||
|
||||
return view('front.post_list', compact('category', 'posts'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user