feat: make author clickable
This commit is contained in:
@ -1,5 +1,4 @@
|
||||
import { Handlers, PageProps } from "$fresh/server.ts";
|
||||
import { RecipeCard } from "@components/RecipeCard.tsx";
|
||||
import { MainLayout } from "@components/layouts/main.tsx";
|
||||
import { getAllRecipes, Recipe } from "@lib/resource/recipes.ts";
|
||||
import { Grid } from "@components/Grid.tsx";
|
||||
@ -8,8 +7,11 @@ import { KMenu } from "@islands/KMenu.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<Recipe[] | null> = {
|
||||
export const handler: Handlers<
|
||||
{ recipes: Recipe[] | null; searchResults?: SearchResult }
|
||||
> = {
|
||||
async GET(req, ctx) {
|
||||
const recipes = await getAllRecipes();
|
||||
const searchParams = parseResourceUrl(req.url);
|
||||
@ -45,7 +47,7 @@ export default function Greet(
|
||||
</header>
|
||||
<Grid>
|
||||
{recipes?.map((doc) => {
|
||||
return <RecipeCard recipe={doc} />;
|
||||
return <ResourceCard sublink="recipes" res={doc} />;
|
||||
})}
|
||||
</Grid>
|
||||
</MainLayout>
|
||||
|
Reference in New Issue
Block a user