feat: 页脚分栏支持最多三栏并行(品牌+3栏目4列自适应布局,编辑器与后端校验上限 3)

This commit is contained in:
2026-08-13 15:44:30 +08:00
parent c8707cf704
commit 6dfa3dd5c1
4 changed files with 31 additions and 10 deletions
+9 -4
View File
@@ -29,20 +29,25 @@ export default function Footer({ settings = {}, version = '' }) {
const desc = settings.footer_desc || settings.site_description || '';
if (style === 'columns') {
// 栏目来源:后台 footer_columns 配置(非空优先);空则回退硬编码导航
// 栏目来源:后台 footer_columns 配置(非空优先,最多取前 3 栏);空则回退硬编码三栏导航
const hardcodedCols = [
{ title: '导航', links: [
{ label: '首页', url: '/' },
{ label: '博客', url: '/blog.html' },
{ label: '论坛', url: '/forum.html' },
] },
{ title: '其他', links: [
{ label: '管理后台', url: '/admin', fullPage: true },
{ title: '阅读', links: [
{ label: '归档', url: '/archive.html' },
{ label: 'RSS 订阅', url: '/feed.xml' },
] },
{ title: '账号', links: [
{ label: '个人中心', url: '/profile.html' },
{ label: '管理后台', url: '/admin', fullPage: true },
{ label: '登录', url: '/login.html' },
] },
];
const customCols = parseFooterColumns(settings.footer_columns);
const cols = customCols.length > 0 ? customCols : hardcodedCols;
const cols = (customCols.length > 0 ? customCols : hardcodedCols).slice(0, 3);
/** 栏目链接:站内路径走 SPA Link(整页跳转项除外);http(s) 外链走 /out 确认页 */
const colLink = (l, i) => {