Replace reverse-proxy/iframe approach with @ebook/@community/@navmini imports under /nav /book /community so localhost:3000 serves all three products directly. Co-authored-by: Cursor <cursoragent@cursor.com>
32 lines
1.0 KiB
TypeScript
32 lines
1.0 KiB
TypeScript
import type { Metadata } from 'next';
|
|
import { getAllChapters, getBook } from '@ebook/lib/book.server';
|
|
import { CoverPage } from '@ebook/components/CoverPage';
|
|
import { buildBookMetadata } from '@ebook/lib/metadata';
|
|
import { getSiteConfig, getAdSlot } from '@ebook/lib/site-config.server';
|
|
import { getServerFeatures } from '@ebook/lib/features.server';
|
|
import { getLocale } from '@ebook/lib/i18n/server';
|
|
|
|
export async function generateMetadata(): Promise<Metadata> {
|
|
const locale = await getLocale();
|
|
return buildBookMetadata(locale);
|
|
}
|
|
|
|
export default async function HomePage() {
|
|
const locale = await getLocale();
|
|
const book = getBook(locale);
|
|
const site = getSiteConfig();
|
|
const f = getServerFeatures();
|
|
const chapterMinutes = Object.fromEntries(
|
|
getAllChapters(locale).map((chapter) => [chapter.slug, chapter.readingMinutes])
|
|
);
|
|
|
|
return (
|
|
<CoverPage
|
|
book={book}
|
|
site={site}
|
|
chapterMinutes={chapterMinutes}
|
|
coverAdSlot={f.ads.enabled ? getAdSlot('coverSlot') : ''}
|
|
/>
|
|
);
|
|
}
|