feat: make author clickable

This commit is contained in:
2023-08-12 18:32:56 +02:00
parent d2a02fcf34
commit 2b4173d759
27 changed files with 257 additions and 174 deletions

View File

@ -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>
);