跳转到主要内容

Documentation Index

Fetch the complete documentation index at: https://help.helloazhenweb.top/llms.txt

Use this file to discover all available pages before exploring further.

lib/birthday-config.ts 是为新寿星搭建 Birthday Wall 时,你最先要编辑的文件。它控制着站点在为谁庆祝、生日是哪一天,以及首页倒计时的文案。其他所有页面 — 电台、报告和祝福墙 — 都会引用 birthdayConfig 来展示正确的姓名与个性化文案。

BirthdayPerson 接口

BirthdayPerson 接口描述了 birthdayConfigperson 对象的结构:
export interface BirthdayPerson {
  name: string;
  nickname?: string;
  birthday: {
    month: number; // 1–12
    day: number;   // 1–31
  };
  greeting?: string;
}

配置字段

person.name
string
必填
寿星的显示名称。该值会在首页标题中突出显示,并被站点中所有个性化文案引用。
person.nickname
string
比名字更短或更随意的称呼。设置后,某些界面元素会使用昵称而非全名,营造更亲切、随意的氛围。
person.birthday.month
number
必填
出生月份,取值为 1(一月)到 12(十二月)的整数。被 getDaysUntilBirthday()isBirthdayToday() 用来驱动倒计时和生日横幅。
person.birthday.day
number
必填
出生日期,取值为 131 的整数。与 month 组合后确定具体的庆祝日期。
person.greeting
string
显示在首页倒计时下方的一段短消息。未设置时默认为 "期待与你相遇"。用它来为整个站点定个调子。
countdown.title
string
渲染在倒计时数字上方的标签。例如 "距离生日还有" 可大致译为 “Days until the birthday”。可以换成你想要的语言或措辞。
countdown.expiredTitle
string
isBirthdayToday() 返回 true(即访客在真正的生日当天打开页面)时,替代倒计时显示的文案。默认值为 "今天是你的生日"(“Today is your birthday”)。

默认配置

文件中自带一份针对某个具体人物的可运行示例:
export const birthdayConfig = {
  person: {
    name: "吴总",
    nickname: "吴总",
    birthday: {
      month: 6,
      day: 19,
    },
    greeting: "期待与你相遇",
  } as BirthdayPerson,

  countdown: {
    title: "距离生日还有",
    expiredTitle: "今天是你的生日",
  },
};

自定义示例

将所有值替换为你寿星的信息:
export const birthdayConfig = {
  person: {
    name: "Alex",
    nickname: "Alex",
    birthday: {
      month: 8,
      day: 15,
    },
    greeting: "Can't wait to celebrate with you!",
  } as BirthdayPerson,

  countdown: {
    title: "Days until the big day",
    expiredTitle: "Today is your birthday",
  },
};
编辑完 birthday-config.ts 后,保存文件并重启开发服务器(npm run dev),或重新部署到托管平台,更改才会生效。