add-expert
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSteps
步骤
-
Add the expert's photo to both:
packages/docs/static/img/freelancers/<firstname>.pngpackages/promo-pages/public/img/freelancers/<firstname>.png
The image should be a square headshot (PNG format). Both paths must have the same file. -
Add an entry to thearray in
experts:packages/promo-pages/src/components/experts/experts-data.tsxtsx{ slug: 'firstname-lastname', name: 'First Last', image: '/img/freelancers/<firstname>.png', website: 'https://example.com' | null, x: 'twitter_handle' | null, github: 'github_username' | null, linkedin: 'in/linkedin-slug/' | null, email: 'email@example.com' | null, videocall: 'https://cal.com/...' | null, since: new Date('YYYY-MM-DD').getTime(), description: ( <div> A short description of the expert's work and specialties. Links to projects can be included with <a> tags. </div> ), },- should be set to today's date
since - must be lowercase, hyphenated version of the name
slug - Set unused social fields to
null - The entry goes at the end of the array (before the closing
experts)]
-
Render the expert card by running in:
packages/docsbun render-cardsThis generates. Verify it says "Rendered experts-<slug>" (not "Existed").packages/docs/static/generated/experts-<slug>.png
-
添加专家照片至以下两个位置:
packages/docs/static/img/freelancers/<firstname>.pngpackages/promo-pages/public/img/freelancers/<firstname>.png
图片应为方形头像(PNG格式)。两个路径下的文件必须完全一致。 -
添加条目至中的
packages/promo-pages/src/components/experts/experts-data.tsx数组:expertstsx{ slug: 'firstname-lastname', name: 'First Last', image: '/img/freelancers/<firstname>.png', website: 'https://example.com' | null, x: 'twitter_handle' | null, github: 'github_username' | null, linkedin: 'in/linkedin-slug/' | null, email: 'email@example.com' | null, videocall: 'https://cal.com/...' | null, since: new Date('YYYY-MM-DD').getTime(), description: ( <div> 一段关于该专家工作内容和专长的简短描述。 可以使用<a>标签添加项目链接。 </div> ), },- 应设为当前日期
since - 必须是姓名的小写连字符形式
slug - 将未使用的社交字段设为
null - 条目需添加至数组的末尾(在闭合
experts之前)]
-
渲染专家卡片,在目录下运行:
packages/docsbun render-cards此命令会生成。请验证输出显示“Rendered experts-<slug>”(而非“Existed”)。packages/docs/static/generated/experts-<slug>.png