Add Django backend, Next.js frontend, and deploy templates
This commit is contained in:
1 parent
fc0c991335
commit
e9cd22d36f
93 files changed
+7840
-1
No files matched your search
@@ -0,0 +1,37 @@
|
||||
import { notFound } from "next/navigation";
|
||||
|
||||
import { getPage, getPages } from "@/lib/api";
|
||||
|
||||
export async function generateStaticParams() {
|
||||
const pages = await getPages();
|
||||
return pages.map((page) => ({ slug: page.slug }));
|
||||
}
|
||||
|
||||
export default async function ContentPage({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ slug: string }>;
|
||||
}) {
|
||||
const { slug } = await params;
|
||||
const page = await getPage(slug);
|
||||
|
||||
if (!page) {
|
||||
notFound();
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="container">
|
||||
<section className="page-hero">
|
||||
<span className="eyebrow">Информация</span>
|
||||
<h1>{page.title}</h1>
|
||||
<p className="page-intro">{page.intro}</p>
|
||||
</section>
|
||||
|
||||
<section className="page-layout page-layout--single">
|
||||
<article className="page-panel">
|
||||
<div className="page-body">{page.body}</div>
|
||||
</article>
|
||||
</section>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user