feat: make author clickable
This commit is contained in:
@ -8,8 +8,11 @@ import { IconArrowLeft } from "@components/icons.tsx";
|
||||
import { RedirectSearchHandler } from "@islands/Search.tsx";
|
||||
import { parseResourceUrl, searchResource } from "@lib/search.ts";
|
||||
import { SearchResult } from "@lib/types.ts";
|
||||
import { ResourceCard } from "@components/Card.tsx";
|
||||
|
||||
export const handler: Handlers<Article[] | null> = {
|
||||
export const handler: Handlers<
|
||||
{ articles: Article[] | null; searchResults?: SearchResult }
|
||||
> = {
|
||||
async GET(req, ctx) {
|
||||
const articles = await getAllArticles();
|
||||
const searchParams = parseResourceUrl(req.url);
|
||||
@ -44,16 +47,12 @@ export default function Greet(
|
||||
<RedirectSearchHandler />
|
||||
<KMenu type="main" context={{ type: "article" }} />
|
||||
<Grid>
|
||||
{articles?.map((doc) => {
|
||||
return (
|
||||
<Card
|
||||
image={doc?.meta?.image || "/placeholder.svg"}
|
||||
thumbnail={doc?.meta?.thumbnail}
|
||||
link={`/articles/${doc.id}`}
|
||||
title={doc.name}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
{articles?.map((doc) => (
|
||||
<ResourceCard
|
||||
sublink="articles"
|
||||
res={doc}
|
||||
/>
|
||||
))}
|
||||
</Grid>
|
||||
</MainLayout>
|
||||
);
|
||||
|
Reference in New Issue
Block a user