book/page.tsx - 书籍首页

book/page.tsx - 书籍首页

基本信息

属性
路径src/app/book/page.tsx
类型Next.js 页面组件 (Server Component)
功能《提示工程互动书》着陆页

功能描述

展示提示工程学习书籍的着陆页,包含书籍介绍、目录结构、开始学习入口,以及 PDF 下载功能。具有完整的 SEO 优化和结构化数据。

导入依赖

import Link from "next/link";
import Image from "next/image";
import { Schoolbell } from "next/font/google";
import { ArrowRight, BookOpen, Sparkles, Brain, Layers, Target, Lightbulb, Gamepad2, Download } from "lucide-react";
import { Button } from "@/components/ui/button";
import type { Metadata } from "next";
import { PixelRobot } from "@/components/kids/elements/pixel-art";
import { getTranslations, getLocale } from "next-intl/server";
import { ContinueReadingButton } from "@/components/book/continue-reading";

字体配置

const kidsFont = Schoolbell({
  subsets: ["latin"],
  weight: "400",
});

元数据

SEO 配置

{
  title: t("metaTitle"),
  description: t("metaDescription"),
  keywords: ["prompt engineering", "ChatGPT prompts", ...],
  authors: [{ name: "Fatih Kadir Akın", url: "..." }],
  creator: "Fatih Kadir Akın",
  publisher: "prompts.chat",
  openGraph: { /* ... */ },
  twitter: { /* ... */ },
  robots: { index: true, follow: true }
}

关键词列表

  • prompt engineering
  • ChatGPT prompts / AI prompts
  • prompt engineering guide/book
  • how to write prompts
  • chain of thought prompting
  • few-shot learning
  • prompt chaining
  • system prompts
  • LLM prompts / GPT prompts / Claude prompts

结构化数据 (JSON-LD)

const jsonLd = {
  "@context": "https://schema.org",
  "@type": "Book",
  name: "The Interactive Book of Prompting",
  author: { "@type": "Person", name: "Fatih Kadir Akın" },
  publisher: { "@type": "Organization", name: "prompts.chat" },
  isAccessibleForFree: true,
  numberOfPages: 25,
  bookFormat: "https://schema.org/EBook",
  license: "https://creativecommons.org/publicdomain/zero/1.0/"
};

UI 结构

Container (max-w-2xl)
├── ContinueReadingButton (条件显示)
├── Book Cover Image
├── Header
│   ├── Author Intro
│   ├── Title
│   └── Subtitle
├── Author Bio
├── Highlights (6 items)
├── Book Structure (8 parts)
├── CTA Buttons (3)
│   ├── Start Reading → /book/00a-preface
│   ├── Skip to Chapter 1 → /book/01-understanding-ai-models
│   └── Download PDF
├── Update Note
├── Kids Section (Promi the Robot)
└── Footer

亮点列表

图标键值主题
Brainhighlights.understanding理解 AI 模型
Targethighlights.crafting构建有效提示
Layershighlights.advanced高级技术
Sparkleshighlights.interactive互动示例
Lightbulbhighlights.realWorld真实用例
BookOpenhighlights.future未来趋势

书籍结构

键值内容
structure.introduction简介
structure.part1第1部分: 理解基础
structure.part2第2部分: 核心技术
structure.part3第3部分: 高级策略
structure.part4第4部分: 实际应用
structure.part5第5部分: 行业应用
structure.part6第6部分: 未来展望
structure.chapters章节总结

CTA 按钮

按钮链接样式
Start Reading/book/00a-prefacePrimary (lg)
Skip to Chapter 1/book/01-understanding-ai-modelsOutline (lg)
Download PDFGitHub raw PDF URLOutline (lg)

PDF URL 格式:

https://raw.githubusercontent.com/f/prompts.chat/refs/heads/main/public/book-pdf/book-{locale}-print.pdf

儿童模式推广

Gradient Box (amber/orange)
├── PixelRobot illustration
├── Question text
├── Title (pixel font)
├── Description
└── Start Playing → /kids

翻译键值

命名空间键值
booktitle, subtitle, interactiveGuideBy
bookauthorIntro, bookDescription
bookwhatYouWillLearn, highlights.*
bookbookStructure, structure.*
bookstartReading, skipToChapter1, downloadPdf
bookcontinuousUpdate, partOfProject
bookkidsSection.*

图片资源

资源路径说明
书籍封面/book-cover-photo.jpgOG 图片和页面展示
PDF 文件/book-pdf/book-{locale}-print.pdf多语言 PDF

组件引用

组件来源用途
ContinueReadingButton@/components/book/continue-reading继续阅读按钮
PixelRobot@/components/kids/elements/pixel-art像素机器人插图

响应式布局

  • 默认: max-w-2xl 居中内容
  • CTA 按钮: flex-col sm:flex-row
  • 儿童区域: flex-col sm:flex-row

路由

路径说明
/book书籍首页(当前)
/book/00a-preface前言/开始阅读
/book/01-understanding-ai-models第1章
/kids儿童模式
← 返回目录