Update (ui)

This commit is contained in:
2023-11-21 22:17:18 +08:00
parent 4827130183
commit 028c9b5190
29 changed files with 193 additions and 159 deletions

View File

@@ -40,13 +40,12 @@ public function searchResults(Request $request, $query)
SEOTools::jsonLd();
SEOTools::setTitle($title, false);
$rss_posts = RssPost::with('category')
->where('status', 'published')
->whereRaw("to_tsvector('english', title || ' ' || bites || ' ' || keyword_list) @@ plainto_tsquery('english', ?)", [trim(preg_replace('/\s+/', ' ', $query))])
->where('published_at', '<=', now())
->orderBy('published_at', 'desc')
->cursorPaginate(60);
$rss_posts = RssPost::with('category')
->where('status', 'published')
->whereRaw("to_tsvector('english', title || ' ' || bites || ' ' || keyword_list) @@ plainto_tsquery('english', ?)", [trim(preg_replace('/\s+/', ' ', $query))])
->where('published_at', '<=', now())
->orderBy('published_at', 'desc')
->cursorPaginate(60);
// breadcrumb json ld
$listItems = [];
@@ -112,12 +111,10 @@ public function category(Request $request, $category_slug)
$category = Category::where('slug', $category_slug)->first();
if (is_null($category))
{
abort(404);
if (is_null($category)) {
abort(404);
}
$breadcrumbs = collect([
['name' => 'Home', 'url' => route('front.home')],
['name' => $category->name, 'url' => null],
@@ -125,7 +122,6 @@ public function category(Request $request, $category_slug)
$title = 'Latest News from FutureWalker';
SEOTools::metatags();
SEOTools::twitter();
SEOTools::opengraph();
@@ -154,6 +150,6 @@ public function category(Request $request, $category_slug)
'itemListElement' => $listItems,
]);
return view('front.rss_post_list', compact('rss_posts', 'breadcrumbs', 'breadcrumb_context', 'page_type','category'));
return view('front.rss_post_list', compact('rss_posts', 'breadcrumbs', 'breadcrumb_context', 'page_type', 'category'));
}
}