| 1 | import { notFound } from "next/navigation"; |
| 2 | |
| 3 | import { createServerClient } |
| 4 | import { ogCard, plural |
| 5 | |
| 6 | export { size, contentType |
| 7 | export const alt = |
| 8 | |
| 9 | export default async function |
| 10 | params, |
| 11 | }: { |
| 12 | params: Promise |
| 13 | }) { |
| 14 | const { username, |
| 15 | |
| 16 | const client = |
| 17 | const [{ data |
| 18 | client.GET("/api/repositories/{username}/{slug} |
| 19 | params: { path: { |
| 20 | }), |
| 21 | client.GET("/api/repositories/{username}/{slug}/languages |
| 22 | params: { path: { |
| 23 | }), |
| 24 | ]); |
| 25 | |
| 26 | // A private repository answers 404 to the crawler, so nothing leaks here. |
| 27 | if (!data) |
| 28 | |
| 29 | return ogCard({ |
| 30 | eyebrow: `${username} |
| 31 | icon: "bookMarked", |
| 32 | title: data.name |
| 33 | description: data.description |
| 34 | stats: [ |
| 35 | { icon: "star", |
| 36 | { icon: "gitFork", |
| 37 | ], |
| 38 | languages: languages.data |
| 39 | }); |
| 40 | } |