-
Notifications
You must be signed in to change notification settings - Fork 0
✨ Improve site quality and content trust #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
532fc3d
044a287
76e8c68
750f517
ca7a9b1
7403548
895673c
ff7dd28
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,15 @@ | ||
| --- | ||
| const today = new Date() | ||
| const showSiteLinks = Astro.url.pathname !== '/' | ||
| --- | ||
|
|
||
| <footer class="py-8 text-center text-sm text-gray-500"> | ||
| <p class="mb-2 font-mono text-xs"> | ||
| This website follows the <a href="/design" class="underline! decoration-gray-400 underline-offset-4 hover:text-gray-900 hover:decoration-gray-900 transition-colors">design guidelines</a> and provides <a href="/agents" class="underline! decoration-gray-400 underline-offset-4 hover:text-gray-900 hover:decoration-gray-900 transition-colors">agent instructions</a>. | ||
| </p> | ||
| { | ||
| showSiteLinks && ( | ||
| <p class="mb-2 font-mono text-xs"> | ||
| This website follows the <a href="/design" class="underline! decoration-gray-400 underline-offset-4 hover:text-gray-900 hover:decoration-gray-900 transition-colors">design guidelines</a> and provides <a href="/agents" class="underline! decoration-gray-400 underline-offset-4 hover:text-gray-900 hover:decoration-gray-900 transition-colors">agent instructions</a>. | ||
| </p> | ||
| ) | ||
| } | ||
| <p>© {today.getFullYear()} Yu Le. All rights reserved.</p> | ||
| </footer> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| --- | ||
| import CornerMarkers from '../CornerMarkers.astro' | ||
| import Bot from '../icons/Bot.astro' | ||
| import Sparkles from '../icons/Sparkles.astro' | ||
| --- | ||
|
|
||
| <div class="relative bg-white border border-gray-200 p-6 h-auto transition-all duration-300 hover:border-gray-400"> | ||
| <CornerMarkers /> | ||
|
|
||
| <div class="pointer-events-none absolute inset-0 overflow-hidden text-gray-900 opacity-[0.05]"> | ||
| <Sparkles class="absolute left-2 top-2 size-16 -rotate-12" /> | ||
| <Bot class="absolute right-2 bottom-2 size-14 rotate-12" /> | ||
| </div> | ||
|
|
||
| <p class="relative z-10 font-mono text-xs leading-relaxed text-gray-500 break-all"> | ||
| This website follows the | ||
| <a | ||
| href="/design" | ||
| class="underline! decoration-gray-400 underline-offset-4 transition-colors hover:text-gray-900 hover:decoration-gray-900" | ||
| > | ||
| design guidelines | ||
| </a> | ||
| and provides | ||
| <a | ||
| href="/agents" | ||
| class="underline! decoration-gray-400 underline-offset-4 transition-colors hover:text-gray-900 hover:decoration-gray-900" | ||
| > | ||
| agent instructions | ||
| </a>. | ||
| </p> | ||
| </div> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,10 +6,11 @@ import ArrowRight from '../icons/ArrowRight.astro' | |
| import ChevronRight from '../icons/ChevronRight.astro' | ||
|
|
||
| interface Props { | ||
| class?: string | ||
| limit?: number | ||
| } | ||
|
|
||
| const { limit = 5 } = Astro.props | ||
| const { class: className, limit = 5 } = Astro.props | ||
|
|
||
| const posts = ( | ||
| await getCollection('posts', ({ data }) => { | ||
|
|
@@ -19,62 +20,76 @@ const posts = ( | |
| --- | ||
|
|
||
| <div | ||
| class="relative bg-white border border-gray-200 p-6 h-full flex flex-col transition-all duration-300 hover:border-gray-400" | ||
| class={`relative flex h-auto flex-col border border-gray-200 bg-white p-6 transition-all duration-300 hover:border-gray-400 ${className ?? ''}`} | ||
| > | ||
| <CornerMarkers /> | ||
|
|
||
| <div | ||
| class="mb-4 flex items-center justify-between border-b border-gray-100 pb-4" | ||
| > | ||
| <h2 class="text-lg font-semibold text-gray-900 font-mono">Posts</h2> | ||
| <span class="px-2 py-0.5 text-sm bg-gray-100 text-gray-600 font-mono"> | ||
| {posts.length} | ||
| </span> | ||
| </div> | ||
|
|
||
| <ul class="flex-1 space-y-1"> | ||
| { | ||
| posts.slice(0, limit).map(post => ( | ||
| <li> | ||
| <a | ||
| href={`/posts/${post.id}`} | ||
| class="group flex items-center justify-between p-3 min-h-[3.25rem] transition-colors hover:bg-gray-50 border border-transparent hover:border-gray-200" | ||
| > | ||
| <div> | ||
| <h3 class="font-medium text-gray-900 group-hover:text-gray-700"> | ||
| {post.data.title} | ||
| {post.data.draft && ( | ||
| <span class="ml-2 px-1.5 py-0.5 text-xs bg-gray-200 text-gray-600"> | ||
| Draft | ||
| </span> | ||
| )} | ||
| {post.data.wip && ( | ||
| <span class="ml-2 px-1.5 py-0.5 text-xs bg-amber-100 text-amber-700"> | ||
| WIP | ||
| </span> | ||
| )} | ||
| </h3> | ||
| <time | ||
| class="text-xs text-gray-500 font-mono" | ||
| datetime={post.data.date.toISOString()} | ||
| > | ||
| {formatDate(post.data.date)} | ||
| </time> | ||
| </div> | ||
| <ChevronRight class="h-4 w-4 text-gray-400 transition-transform group-hover:translate-x-0.5" /> | ||
| </a> | ||
| </li> | ||
| )) | ||
| } | ||
| </ul> | ||
|
|
||
| <div class="mt-auto flex justify-center pt-6 border-t border-gray-100"> | ||
| <h2 class="text-lg font-semibold text-gray-900 font-mono">Posts | ||
| <span class="px-2 py-0.5 text-sm bg-gray-100 text-gray-600 font-mono"> | ||
| {posts.length} | ||
| </span> | ||
| </h2> | ||
| <a | ||
| href="/posts" | ||
| class="inline-flex items-center gap-2 px-4 py-3 min-h-[2.75rem] text-sm bg-gray-100 text-gray-600 hover:bg-gray-200 hover:text-gray-900 transition-colors font-mono" | ||
| class="inline-flex items-center gap-1 text-xs text-gray-400 font-mono transition-colors hover:text-gray-600 underline underline-offset-2 decoration-gray-200 hover:decoration-gray-400" | ||
| > | ||
| View more | ||
| View all | ||
| <ArrowRight class="h-3 w-3" /> | ||
| </a> | ||
| </div> | ||
|
|
||
| <div class="relative min-h-0 flex-1 overflow-hidden"> | ||
| <ul class="space-y-1 pb-8"> | ||
| { | ||
| posts.slice(0, limit).map(post => ( | ||
| <li> | ||
| <a | ||
| href={`/posts/${post.id}`} | ||
| class="group flex min-h-13 items-start justify-between gap-3 p-3 transition-colors hover:bg-gray-50 border border-transparent hover:border-gray-200" | ||
| > | ||
| <div class="min-w-0"> | ||
| <h3 class="font-medium text-gray-900 group-hover:text-gray-700"> | ||
| {post.data.title} | ||
| {post.data.draft && ( | ||
| <span class="ml-2 px-1.5 py-0.5 text-xs bg-gray-200 text-gray-600"> | ||
| Draft | ||
| </span> | ||
| )} | ||
| {post.data.wip && ( | ||
| <span class="ml-2 px-1.5 py-0.5 text-xs bg-amber-100 text-amber-700"> | ||
| WIP | ||
| </span> | ||
| )} | ||
| </h3> | ||
| <p class="mt-1 line-clamp-2 text-sm leading-snug text-gray-600"> | ||
| {post.data.description} | ||
| </p> | ||
| <time | ||
| class="mt-2 block text-xs text-gray-500 font-mono" | ||
| datetime={post.data.date.toISOString()} | ||
| > | ||
| {formatDate(post.data.date)} | ||
| </time> | ||
| {post.data.tags && post.data.tags.length > 0 && ( | ||
| <div class="mt-2 flex flex-wrap gap-1.5"> | ||
| {post.data.tags.slice(0, 3).map(tag => ( | ||
| <span class="border border-gray-200 px-1.5 py-0.5 text-[10px] leading-none text-gray-500"> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The font size |
||
| {tag} | ||
| </span> | ||
| ))} | ||
| </div> | ||
| )} | ||
| </div> | ||
| <ChevronRight class="h-4 w-4 shrink-0 self-center text-gray-400 transition-transform group-hover:translate-x-0.5" /> | ||
| </a> | ||
| </li> | ||
| )) | ||
| } | ||
| </ul> | ||
| <div class="pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-linear-to-t from-white via-white/80 to-transparent backdrop-blur-[0.5px]" /> | ||
| </div> | ||
|
|
||
| </div> | ||
Uh oh!
There was an error while loading. Please reload this page.