完善站点运营设置:分路由管理、登录可见评论、邮件模板内联与关闭注册 SSR。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -4,8 +4,25 @@ export type FooterLink = {
|
||||
label: string;
|
||||
url: string;
|
||||
new_tab: boolean;
|
||||
/** 所属栏位:left / center / right;缺省 right */
|
||||
align: FooterLinksAlign;
|
||||
};
|
||||
|
||||
/** 页脚链接栏位 */
|
||||
export type FooterLinksAlign = "left" | "center" | "right";
|
||||
|
||||
export const FOOTER_LINKS_ALIGNS: { id: FooterLinksAlign; label: string }[] = [
|
||||
{ id: "left", label: "左" },
|
||||
{ id: "center", label: "中" },
|
||||
{ id: "right", label: "右" },
|
||||
];
|
||||
|
||||
export function normalizeFooterLinksAlign(raw: unknown): FooterLinksAlign {
|
||||
const s = String(raw ?? "").trim();
|
||||
if (s === "left" || s === "center" || s === "right") return s;
|
||||
return "right";
|
||||
}
|
||||
|
||||
export type BrandSlot = "logo_light" | "logo_dark" | "favicon";
|
||||
|
||||
/** 页眉品牌形式 */
|
||||
@@ -135,7 +152,8 @@ export function normalizeFooterLinks(raw: unknown): FooterLink[] {
|
||||
if (!footerURLAllowed(url)) continue;
|
||||
const omitted = rec.new_tab === undefined || rec.new_tab === null;
|
||||
const newTab = omitted ? isExternalFooterURL(url) : rec.new_tab !== false;
|
||||
out.push({ label, url, new_tab: newTab });
|
||||
const align = normalizeFooterLinksAlign((rec as { align?: unknown }).align);
|
||||
out.push({ label, url, new_tab: newTab, align });
|
||||
if (out.length >= BRAND_LIMITS.footerLinks) break;
|
||||
}
|
||||
return out;
|
||||
|
||||
Reference in New Issue
Block a user