feat: sort page list and fix margins
This commit is contained in:
parent
10d5e06d8f
commit
c6a26354ab
|
|
@ -12,12 +12,12 @@ export const SiteHome: React.FC<{
|
|||
<div className="">
|
||||
{posts.total === 0 && <EmptyState />}
|
||||
{posts.total > 0 && (
|
||||
<div className="space-y-8">
|
||||
<div className="space-y-3">
|
||||
{posts.list.map((post) => {
|
||||
const excerpt = post.summary?.content
|
||||
return (
|
||||
<Link key={post.slug} href={`/${post.slug}`}>
|
||||
<a className="block hover:bg-zinc-100 transition-colors p-5 -mx-5 -my-5 md:rounded-xl">
|
||||
<a className="block hover:bg-zinc-100 transition-colors p-5 -mx-5 first:-mt-5 md:rounded-xl">
|
||||
<h3 className="text-2xl font-bold">{post.title}</h3>
|
||||
<div className="text-sm text-zinc-400 mt-1">
|
||||
{formatDate(post.date_published)}
|
||||
|
|
|
|||
|
|
@ -151,6 +151,7 @@ export async function getPagesBySite(input: {
|
|||
page.applications?.includes("xlog"),
|
||||
)
|
||||
.filter((page) => page.tags?.includes(input.type))
|
||||
.sort((a, b) => +new Date(b.date_published) - +new Date(a.date_published))
|
||||
pages.total = pages.list.length
|
||||
|
||||
pages.list = await Promise.all(
|
||||
|
|
|
|||
Loading…
Reference in New Issue