import { RouteContext } from '$fresh/server.ts' import { BlogPost } from ':components/BlogBlocks.tsx' import { fetchNews } from ':src/blog/mod.ts' export default async function Blog(_req: Request, { params }: RouteContext) { try { const article = await fetchNews('cohabit', params.name) return BlogPost(article) } catch { return ( <>
{`Impossible de récupérer l'article "${params.name}"`}.
> ) } }