feat(frontend): connect Next.js server components to Go backend REST API with resilient fallback
- Implement typed REST API client in refer_landing_page/lib/api.ts - Support API_BASE_URL environment variable with graceful fallback to static content - Connect Home page (projects, areas, stats), Members page (active, alumni), Publications (highlights, list, patents), Lectures, and Standardization pages to backend endpoints - Pass all 12 SSG build, TypeScript, ESLint, and E2E quality gates
This commit is contained in:
@@ -1,13 +1,23 @@
|
||||
import type { Metadata } from "next";
|
||||
import { CategoryNav } from "./_components/CategoryNav";
|
||||
import { publications } from "../../content/publications";
|
||||
import { publications as staticPubs, patents as staticPatents } from "../../content/publications";
|
||||
import { getPublications, getPatents } from "../../lib/api";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Publications",
|
||||
description: "AI Agent Networking Lab (ANL) research publications and patents overview",
|
||||
};
|
||||
|
||||
export default function PublicationsIndexPage() {
|
||||
export default async function PublicationsIndexPage() {
|
||||
const publications = (await getPublications()) ?? staticPubs;
|
||||
const patents = (await getPatents()) ?? staticPatents;
|
||||
|
||||
const counts = {
|
||||
"intl-journal-conf": publications.filter((p) => p.category === "intl-journal-conf").length,
|
||||
"domestic-journal-conf": publications.filter((p) => p.category === "domestic-journal-conf").length,
|
||||
patent: patents.length,
|
||||
};
|
||||
|
||||
// Selected representative publications (curated via database isHighlight flag)
|
||||
const highlights = publications.filter((p) => p.isHighlight);
|
||||
|
||||
@@ -22,7 +32,7 @@ export default function PublicationsIndexPage() {
|
||||
|
||||
{/* Category Summary Cards */}
|
||||
<section className="pt-6 md:pt-8 border-t border-line">
|
||||
<CategoryNav />
|
||||
<CategoryNav counts={counts} />
|
||||
</section>
|
||||
|
||||
{/* Highlights Section */}
|
||||
|
||||
Reference in New Issue
Block a user