社交媒体
配置公开社交链接,并区分 Social Auth Provider 与品牌资料链接。
Tanplate 把“用于登录的 Social Auth Provider”和“展示品牌资料的社交媒体链接”视为两类配置。两者不能共用一个开关。
Social Auth
登录 Provider 在 project.manifest.json 中显式选择:
{
"providers": {
"socialAuth": ["google", "github"]
}
}当前支持 Google 与 GitHub。Provider intent 可以提交;client ID 和 client secret 只进入 Web Worker secret,Admin 不配置 Social Auth。完整变量见 环境配置。
公开社交链接
当前 Manifest 没有 social 品牌资料字段,Web Header/Footer 也不会因为启用 GitHub 登录就自动展示 GitHub 链接。这是有意隔离:登录能力不代表项目拥有或愿意公开同名社交账号。
需要公开 GitHub、X、YouTube 等品牌链接时,在实际消费它们的布局附近维护一个小型、类型化的常量。例如 Footer 可以使用:
const socialLinks = [
{
href: 'https://github.com/your-organization',
icon: 'i-carbon-logo-github',
label: 'GitHub',
},
] as const然后以外部 <a> 渲染,提供可见 label 或 aria-label。若多个应用都要消费同一组链接,再把它提升为经过 Schema 校验的共享配置;不要为了单个 Footer 预先扩展 Manifest。
图标
- GitHub、X、YouTube 等真实品牌可以使用本地 Simple Icons 或 Carbon 品牌图标。
- 邮件、外链、分享等通用动作使用 Solar/Carbon 通用图标。
- 禁止运行时请求远程图标,也不要在 Web 导入
lucide-react。
外部链接安全
新窗口打开时使用 target="_blank" 和 rel="noreferrer noopener"。链接必须使用明确的 HTTPS URL;支持邮箱用经过校验的 mailto:,不要把用户输入直接拼入 href。
验证
检查窄屏 Footer/Header、键盘焦点、可访问名称和链接目标。修改 Social Auth 时额外运行 Auth profile build 与登录 E2E;只增加公开品牌链接时,不应改变 Auth 或环境要求。