This commit is contained in:
MuslemRahimi 2025-02-12 13:52:49 +01:00
parent f58508fbc4
commit 2784416eb3
2 changed files with 15 additions and 11 deletions

View File

@ -7,7 +7,7 @@ export const load = async ({locals}) => {
// make the POST request to the endpoint // make the POST request to the endpoint
const output = await pb.collection("tutorials").getFullList({ const output = await pb.collection("tutorials").getFullList({
sort: "-updated", sort: "-created",
}); });
return output; return output;

View File

@ -27,15 +27,16 @@
</h1> </h1>
</div> </div>
<div class="w-full grid grid-cols-1 sm:grid-cols-3 gap-y-5 sm:gap-y-0 sm:gap-5"> <div class="w-full grid grid-cols-1 sm:grid-cols-3 gap-y-5 sm:gap-5">
{#if allBlogPosts?.length !== 0} {#if allBlogPosts?.length !== 0}
{#each allBlogPosts as item} {#each allBlogPosts as item}
<div <div
class="flex flex-col overflow-hidden rounded shadow-lg sm:hover:shadow-2xl border border-gray-600" class="flex flex-col overflow-hidden rounded shadow-lg sm:hover:shadow-2xl border border-gray-600"
> >
<div class="flex-shrink-0"> <div class="flex-shrink-0">
<a href={"/learning-center/article/" + convertToSlug(item?.title)} <a
href={"/learning-center/article/" +
convertToSlug(item?.title)}
><img ><img
class="h-48 w-full object-cover" class="h-48 w-full object-cover"
src={getImageURL( src={getImageURL(
@ -53,9 +54,12 @@
> >
<div class="flex-1"> <div class="flex-1">
<a <a
href={"/learning-center/article/" + convertToSlug(item?.title)} href={"/learning-center/article/" +
convertToSlug(item?.title)}
class="block" class="block"
><h2 class="text-lg sm:text-xl font-semibold text-white"> ><h2
class="text-lg sm:text-xl font-semibold text-white"
>
{item?.title} {item?.title}
</h2> </h2>
<p class="mt-3 text-sm text-white"> <p class="mt-3 text-sm text-white">
@ -67,19 +71,19 @@
</div> </div>
<div class="mt-3 flex items-center"> <div class="mt-3 flex items-center">
<div class="flex space-x-1 text-sm text-white"> <div class="flex space-x-1 text-sm text-white">
<span class="font-semibold">Published:</span> <time datetime={item?.created} class="ml-1"> <span class="font-semibold">Published:</span>
<time datetime={item?.created} class="ml-1">
{new Date(item?.created)?.toLocaleString("en-US", { {new Date(item?.created)?.toLocaleString("en-US", {
month: "short", month: "short",
day: "numeric", day: "numeric",
year: "numeric", year: "numeric",
daySuffix: "2-digit", daySuffix: "2-digit",
})}</time })}</time
> >
</div> </div>
</div> </div>
<div class="flex flex-col text-white mt-3"> <div class="flex flex-col text-white mt-3">
<div class="flex flex-wrap gap-x-2 gap-y-3 "> <div class="flex flex-wrap gap-x-2 gap-y-3">
{#each item?.tags as tags} {#each item?.tags as tags}
<label <label
class="px-2 text-sm py-1 text-black rounded bg-white ml-0" class="px-2 text-sm py-1 text-black rounded bg-white ml-0"