fixes
This commit is contained in:
@@ -81,7 +81,7 @@ export default function AuthorPage({ params }: { params: { slug: string } }) {
|
||||
<div className="space-y-4">
|
||||
{posts.map(p => (
|
||||
<Link key={p.slug} href={`/blog/${p.slug}`} className="block group p-6 rounded-xl border border-gray-200 bg-white hover:border-blue-200 hover:shadow-sm transition-all">
|
||||
<div className="text-sm text-gray-400 mb-1">{p.date}</div>
|
||||
<div className="text-sm text-gray-400 mb-1">{new Date(p.datePublished || p.date).toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' })}</div>
|
||||
<h3 className="text-xl font-bold text-gray-900 group-hover:text-blue-700 transition-colors mb-2">{p.title}</h3>
|
||||
<p className="text-gray-600">{p.description}</p>
|
||||
</Link>
|
||||
|
||||
@@ -55,7 +55,7 @@ export default function PillarPage({ params }: { params: { pillar: PillarKey } }
|
||||
<div className="grid md:grid-cols-2 gap-6">
|
||||
{posts.map(p => (
|
||||
<Link key={p.slug} href={`/blog/${p.slug}`} className="group block rounded-xl border border-gray-200 bg-white p-6 shadow-sm hover:shadow-md hover:border-blue-200 transition-all">
|
||||
<div className="text-xs text-gray-400 mb-2">{p.date}</div>
|
||||
<div className="text-xs text-gray-400 mb-2">{new Date(p.datePublished || p.date).toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' })}</div>
|
||||
<div className="text-lg font-bold text-gray-900 mb-2 group-hover:text-blue-700">{p.title}</div>
|
||||
<div className="text-sm text-gray-600 line-clamp-2">{p.description}</div>
|
||||
</Link>
|
||||
|
||||
@@ -10,7 +10,11 @@ export const metadata = {
|
||||
export default function LearnHubPage() {
|
||||
const posts = getPublishedPosts();
|
||||
// Sort by date descending
|
||||
const topLatest = [...posts].sort((a, b) => (new Date(a.datePublished).getTime() < new Date(b.datePublished).getTime() ? 1 : -1)).slice(0, 6);
|
||||
const topLatest = [...posts].sort((a, b) => {
|
||||
const dateA = a.datePublished ? new Date(a.datePublished) : new Date(a.date);
|
||||
const dateB = b.datePublished ? new Date(b.datePublished) : new Date(b.date);
|
||||
return dateB.getTime() - dateA.getTime();
|
||||
}).slice(0, 6);
|
||||
|
||||
return (
|
||||
<main className="container mx-auto max-w-5xl py-12 px-4 space-y-12">
|
||||
@@ -41,7 +45,7 @@ export default function LearnHubPage() {
|
||||
<Link key={p.slug} href={`/blog/${p.slug}`} className="group block rounded-2xl border border-gray-200 bg-white p-6 shadow-sm hover:shadow-md hover:border-blue-200 transition-all">
|
||||
<div className="flex justify-between items-center mb-3">
|
||||
<div className="text-xs font-semibold px-2 py-1 rounded bg-gray-100 text-gray-600">{p.pillar?.toUpperCase() || 'GUIDE'}</div>
|
||||
<div className="text-xs text-gray-400">{p.date}</div>
|
||||
<div className="text-xs text-gray-400">{new Date(p.datePublished || p.date).toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' })}</div>
|
||||
</div>
|
||||
<div className="text-xl font-bold text-gray-900 mb-2 group-hover:text-blue-700 line-clamp-2">{p.title}</div>
|
||||
<div className="text-gray-600 line-clamp-2">{p.description}</div>
|
||||
|
||||
Reference in New Issue
Block a user