|
| 1 | +import type { Metadata } from "next"; |
1 | 2 | import { desc, eq } from "drizzle-orm"; |
2 | 3 | import HeroSection from "@/components/sections/HeroSection"; |
3 | 4 | import HackathonStrip from "@/components/sections/HackathonStrip"; |
4 | 5 | import LatestReleasesSection from "@/components/sections/LatestReleasesSection"; |
5 | 6 | import ProductsSection from "@/components/sections/ProductsSection"; |
6 | 7 | import { blogPosts, db, products } from "@/db"; |
7 | 8 |
|
8 | | -export const dynamic = "force-dynamic"; |
| 9 | +export const revalidate = 3600; |
| 10 | + |
| 11 | +const title = "CodedDevs Technology LTD"; |
| 12 | +const description = |
| 13 | + "Engineering software that works for Africa. AI-first products built for African markets from first principles."; |
| 14 | + |
| 15 | +export const metadata: Metadata = { |
| 16 | + title, |
| 17 | + description, |
| 18 | + openGraph: { |
| 19 | + title, |
| 20 | + description, |
| 21 | + url: "https://codeddevs.com", |
| 22 | + siteName: "CodedDevs Technology LTD", |
| 23 | + type: "website", |
| 24 | + }, |
| 25 | + twitter: { |
| 26 | + card: "summary_large_image", |
| 27 | + title, |
| 28 | + description, |
| 29 | + }, |
| 30 | +}; |
9 | 31 |
|
10 | 32 | async function getFeaturedProducts() { |
11 | 33 | try { |
12 | 34 | return await db |
13 | | - .select() |
| 35 | + .select({ |
| 36 | + id: products.id, |
| 37 | + name: products.name, |
| 38 | + slug: products.slug, |
| 39 | + tagline: products.tagline, |
| 40 | + cover_url: products.cover_url, |
| 41 | + external_url: products.external_url, |
| 42 | + status: products.status, |
| 43 | + is_featured: products.is_featured, |
| 44 | + }) |
14 | 45 | .from(products) |
15 | 46 | .where(eq(products.is_featured, true)) |
16 | 47 | .orderBy(products.order_index); |
17 | | - } catch (error) { |
18 | | - console.error("Failed to fetch featured products", error); |
| 48 | + } catch { |
19 | 49 | return []; |
20 | 50 | } |
21 | 51 | } |
22 | 52 |
|
23 | 53 | async function getLatestPosts() { |
24 | 54 | try { |
25 | 55 | return await db |
26 | | - .select() |
| 56 | + .select({ |
| 57 | + id: blogPosts.id, |
| 58 | + title: blogPosts.title, |
| 59 | + slug: blogPosts.slug, |
| 60 | + excerpt: blogPosts.excerpt, |
| 61 | + category: blogPosts.category, |
| 62 | + published_at: blogPosts.published_at, |
| 63 | + }) |
27 | 64 | .from(blogPosts) |
28 | 65 | .where(eq(blogPosts.is_published, true)) |
29 | 66 | .orderBy(desc(blogPosts.published_at)) |
30 | 67 | .limit(3); |
31 | | - } catch (error) { |
32 | | - console.error("Failed to fetch latest posts", error); |
| 68 | + } catch { |
33 | 69 | return []; |
34 | 70 | } |
35 | 71 | } |
|
0 commit comments