feat(frontend): replace article system with Zibll 9.0
This commit is contained in:
1 parent
2881c69e9c
commit
0f2ac6c34a
69 files changed
+2603
-4163
No files matched your search
@@ -313,7 +313,7 @@ export const pageDisplaySchemas = {
|
||||
user_home_tabs_mobile_hide: '',
|
||||
user_home_sidebar: false,
|
||||
user_home_cover: true,
|
||||
user_home_route_identifier: 'nicename',
|
||||
user_home_route_identifier: 'nicename',
|
||||
user_home_follow: true,
|
||||
user_home_posts_per_page: 10,
|
||||
user_home_avatar: true,
|
||||
@@ -333,7 +333,7 @@ export const pageDisplaySchemas = {
|
||||
icon: 'fas fa-th-large',
|
||||
fields: [
|
||||
{ key: 'user_home_cover', label: '封面区域', type: 'switch', default: true, help: '用户主页顶部封面图' },
|
||||
{ key: 'user_home_route_identifier', label: '主页 URL 标识', type: 'select', default: 'nicename', options: [{ label: '用户名 URL slug', value: 'nicename' }, { label: '数字用户 ID', value: 'uid' }] },
|
||||
{ key: 'user_home_route_identifier', label: '主页 URL 标识', type: 'select', default: 'nicename', options: [{ label: '用户名 URL slug', value: 'nicename' }, { label: '数字用户 ID', value: 'uid' }] },
|
||||
{ key: 'user_home_sidebar', label: '侧边栏(已弃用)', type: 'switch', default: false, help: '公开主页为通栏布局(对齐 Zibll author);运行时强制关闭。交易服务请去用户中心。' },
|
||||
{ key: 'user_home_follow', label: '关注按钮', type: 'switch', default: true },
|
||||
{ key: 'user_home_posts_per_page', label: '每页文章数', type: 'number', default: 10, min: 5, max: 50 },
|
||||
@@ -929,15 +929,11 @@ export const pageDisplaySchemas = {
|
||||
key: 'page_display.homepage',
|
||||
title: '首页配置',
|
||||
icon: 'fas fa-home',
|
||||
description: '配置首页主列表、分类 Tab、卡片样式与首页交互。实际编辑界面在 HomepageSettings.vue(customPage),此处补齐 page_display 的 schema 契约。',
|
||||
description: '配置首页主列表、分类 Tab 与首页交互。文章列表视觉统一由文章列表设置控制。',
|
||||
defaults: {
|
||||
homepage_tabs: [],
|
||||
homepage_card_style: 'default',
|
||||
homepage_multi_thumb_enabled: false,
|
||||
homepage_multi_thumb_min_images: 3,
|
||||
homepage_sidebar_mini_enabled: true,
|
||||
homepage_default_sort: 'date',
|
||||
homepage_default_view: 'list',
|
||||
homepage_sort_ajax_enabled: true,
|
||||
homepage_sticky_tabs_enabled: true,
|
||||
home_posts_list_s: true,
|
||||
@@ -986,34 +982,9 @@ export const pageDisplaySchemas = {
|
||||
},
|
||||
{
|
||||
key: 'cards-sidebar',
|
||||
title: '卡片与侧栏',
|
||||
title: '侧栏与交互',
|
||||
icon: 'fas fa-columns',
|
||||
fields: [
|
||||
{
|
||||
key: 'homepage_card_style',
|
||||
label: '卡片风格(已弃用)',
|
||||
type: 'radio',
|
||||
default: 'default',
|
||||
options: [
|
||||
{ label: '默认', value: 'default' },
|
||||
{ label: '风格 2', value: 'style2' },
|
||||
{ label: '风格 3', value: 'style3' },
|
||||
],
|
||||
help: '已弃用:请改用「文章列表」中的列表/卡片样式设置。',
|
||||
},
|
||||
{ key: 'homepage_multi_thumb_enabled', label: '多图卡片(已弃用)', type: 'switch', default: true, help: '请改用文章列表缩略图/多图设置。' },
|
||||
{ key: 'homepage_multi_thumb_min_images', label: '最少图片数(已弃用)', type: 'number', default: 3, min: 2, max: 4 },
|
||||
{
|
||||
key: 'homepage_default_view',
|
||||
label: '默认视图(已弃用)',
|
||||
type: 'radio',
|
||||
default: 'list',
|
||||
options: [
|
||||
{ label: '列表', value: 'list' },
|
||||
{ label: '卡片', value: 'card' },
|
||||
],
|
||||
help: 'SSR 以文章列表全局设置为准;此字段仅作兼容保留。',
|
||||
},
|
||||
{ key: 'homepage_sidebar_mini_enabled', label: '迷你侧栏列表', type: 'switch', default: true },
|
||||
{ key: 'homepage_sort_ajax_enabled', label: '排序栏 AJAX', type: 'switch', default: true },
|
||||
],
|
||||
|
||||
@@ -1,237 +1,104 @@
|
||||
/**
|
||||
* Post list — list section (Zibll-aligned admin contract).
|
||||
* Keys match PHP AKSRT_Admin_Schema_Post_List_List / Zibll option IDs.
|
||||
*/
|
||||
|
||||
/** Zibll 9.0 article-list settings. */
|
||||
export const listSchema = {
|
||||
key: 'post_list.list',
|
||||
title: '文章列表',
|
||||
icon: 'fas fa-list',
|
||||
description: '对齐 Zibll 文章列表:默认排序、置顶范围、翻页模式(数字/AJAX/自动加载)与列表显示部件。',
|
||||
description: '文章列表模式、UI、标签和翻页行为。',
|
||||
defaults: {
|
||||
list_orderby: 'modified',
|
||||
post_time_source: 'modified',
|
||||
sticky_s: ['home', 'cat'],
|
||||
target_blank: false,
|
||||
item_heading_bold: false,
|
||||
post_list_author: true,
|
||||
post_list_time: true,
|
||||
list_meta_show: 'like',
|
||||
list_badge_show: ['pay', 'tag', 'cat'],
|
||||
list_badge_show: ['pay', 'cat', 'tag'],
|
||||
list_show_type: 'separate',
|
||||
list_type: 'thumb',
|
||||
list_card_home: false,
|
||||
list_card_tag: false,
|
||||
list_card_author: false,
|
||||
list_card_cat: [],
|
||||
list_list_option: { style: 'null', img_position: 'left', scale: 70 },
|
||||
list_card_option: { style: 'null', scale: 70 },
|
||||
mult_thumb_cat: [],
|
||||
paging_ajax_s: '1',
|
||||
paging_ajax_ias_s: true,
|
||||
ias_max: 3,
|
||||
ajax_trigger: '加载更多',
|
||||
ajax_nomore: '没有更多了',
|
||||
post_card_style: 'thumb',
|
||||
post_excerpt_length: 120,
|
||||
post_list_per_page: 12,
|
||||
list_show_type: 'separate',
|
||||
list_list_style: '',
|
||||
list_list_img_position: 'left',
|
||||
list_list_scale: 70,
|
||||
list_card_style: '',
|
||||
list_card_scale: 70,
|
||||
list_card_home: false,
|
||||
list_card_cat: [],
|
||||
list_card_tag: false,
|
||||
list_card_author: false,
|
||||
ajax_trigger: '<i class="fa fa-angle-right"></i>加载更多',
|
||||
ajax_nomore: '没有更多内容了',
|
||||
},
|
||||
groups: [
|
||||
{
|
||||
key: 'order',
|
||||
title: '默认排序与置顶',
|
||||
icon: 'fas fa-sort',
|
||||
fields: [
|
||||
{
|
||||
key: 'list_orderby',
|
||||
label: '默认排序方式',
|
||||
type: 'radio',
|
||||
default: 'modified',
|
||||
options: [
|
||||
{ label: '发布时间', value: 'date' },
|
||||
{ label: '更新时间', value: 'modified' },
|
||||
{ label: 'WP默认', value: 'default' },
|
||||
],
|
||||
help: '文章列表全局默认排序(Zibll list_orderby)',
|
||||
},
|
||||
{
|
||||
key: 'sticky_s',
|
||||
label: '显示置顶文章',
|
||||
type: 'checkbox',
|
||||
default: ['home', 'cat'],
|
||||
options: [
|
||||
{ label: '首页', value: 'home' },
|
||||
{ label: '分类页', value: 'cat' },
|
||||
{ label: '标签页', value: 'tag' },
|
||||
],
|
||||
},
|
||||
key: 'order', title: '默认排序与置顶', icon: 'fas fa-sort', fields: [
|
||||
{ key: 'list_orderby', label: '默认排序方式', type: 'radio', default: 'modified', options: [
|
||||
{ label: '发布时间', value: 'date' }, { label: '更新时间', value: 'modified' }, { label: 'WP默认', value: 'default' },
|
||||
] },
|
||||
{ key: 'post_time_source', label: '时间显示数据源', type: 'radio', default: 'modified', options: [
|
||||
{ label: '发布时间', value: 'date' }, { label: '更新时间', value: 'modified' },
|
||||
] },
|
||||
{ key: 'sticky_s', label: '显示置顶文章', type: 'checkbox', default: ['home', 'cat'], options: [
|
||||
{ label: '首页', value: 'home' }, { label: '分类页', value: 'cat' }, { label: '标签页', value: 'tag' },
|
||||
] },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'display',
|
||||
title: '列表显示',
|
||||
icon: 'fas fa-eye',
|
||||
fields: [
|
||||
key: 'display', title: '列表显示', icon: 'fas fa-eye', fields: [
|
||||
{ key: 'target_blank', label: '新窗口打开文章', type: 'switch', default: false },
|
||||
{ key: 'item_heading_bold', label: '列表标题粗体显示', type: 'switch', default: false },
|
||||
{ key: 'post_list_author', label: '显示文章作者', type: 'switch', default: true },
|
||||
{
|
||||
key: 'post_list_time',
|
||||
label: '显示文章时间',
|
||||
type: 'switch',
|
||||
default: true,
|
||||
help: '建议作者与时间至少开启一项',
|
||||
},
|
||||
{
|
||||
key: 'list_meta_show',
|
||||
label: '列表小部件(移动端优先)',
|
||||
type: 'radio',
|
||||
default: 'like',
|
||||
options: [
|
||||
{ label: '阅读量', value: 'view' },
|
||||
{ label: '点赞数', value: 'like' },
|
||||
{ label: '评论', value: 'comm' },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'list_badge_show',
|
||||
label: '列表徽章',
|
||||
type: 'checkbox',
|
||||
default: ['pay', 'tag', 'cat'],
|
||||
options: [
|
||||
{ label: '付费', value: 'pay' },
|
||||
{ label: '分类', value: 'cat' },
|
||||
{ label: '标签', value: 'tag' },
|
||||
],
|
||||
},
|
||||
{ key: 'post_list_time', label: '显示文章时间', type: 'switch', default: true },
|
||||
{ key: 'list_meta_show', label: '列表小部件(移动端优先)', type: 'radio', default: 'like', options: [
|
||||
{ label: '阅读量', value: 'view' }, { label: '点赞数', value: 'like' }, { label: '评论', value: 'comm' },
|
||||
] },
|
||||
{ key: 'list_badge_show', label: '显示列表标签', type: 'checkbox', default: ['pay', 'cat', 'tag'], options: [
|
||||
{ label: '付费信息', value: 'pay' }, { label: '分类', value: 'cat' }, { label: '标签', value: 'tag' },
|
||||
] },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'paging',
|
||||
title: '列表翻页',
|
||||
icon: 'fas fa-ellipsis-h',
|
||||
fields: [
|
||||
{
|
||||
key: 'paging_ajax_s',
|
||||
label: '列表翻页模式',
|
||||
type: 'radio',
|
||||
default: '1',
|
||||
options: [
|
||||
{ label: 'AJAX 追加列表翻页', value: '1' },
|
||||
{ label: '数字翻页按钮', value: '0' },
|
||||
],
|
||||
help: '对齐 Zibll paging_ajax_s',
|
||||
},
|
||||
{
|
||||
key: 'paging_ajax_ias_s',
|
||||
label: 'AJAX 自动加载',
|
||||
type: 'switch',
|
||||
default: true,
|
||||
dependsOn: { key: 'paging_ajax_s', value: '1' },
|
||||
help: '滚动到列表尽头时自动加载下一页',
|
||||
},
|
||||
{
|
||||
key: 'ias_max',
|
||||
label: '自动加载页数',
|
||||
type: 'number',
|
||||
default: 3,
|
||||
min: 0,
|
||||
max: 10,
|
||||
dependsOn: { key: 'paging_ajax_s', value: '1' },
|
||||
help: '0 表示不限制',
|
||||
},
|
||||
{
|
||||
key: 'ajax_trigger',
|
||||
label: '加载更多文案',
|
||||
type: 'input',
|
||||
default: '加载更多',
|
||||
dependsOn: { key: 'paging_ajax_s', value: '1' },
|
||||
},
|
||||
{
|
||||
key: 'ajax_nomore',
|
||||
label: '没有更多文案',
|
||||
type: 'input',
|
||||
default: '没有更多了',
|
||||
dependsOn: { key: 'paging_ajax_s', value: '1' },
|
||||
},
|
||||
key: 'layout', title: '列表模式与 UI', icon: 'fas fa-th-large', fields: [
|
||||
{ key: 'list_show_type', label: '列表样式', type: 'radio', default: 'separate', options: [
|
||||
{ label: '分离', value: 'separate' }, { label: '无间距', value: 'no_margin' },
|
||||
] },
|
||||
{ key: 'list_type', label: '默认列表模式', type: 'radio', default: 'thumb', options: [
|
||||
{ label: '列表文字模式', value: 'text' },
|
||||
{ label: '列表图文模式', value: 'thumb' },
|
||||
{ label: '列表自动图文模式', value: 'thumb_if_has' },
|
||||
{ label: '卡片模式', value: 'card' },
|
||||
], help: '文字、自动图文和多图模式仅在开启侧栏的页面有效。' },
|
||||
{ key: 'list_card_home', label: '首页列表卡片模式', type: 'switch', default: false, dependsOn: { key: 'list_type', not: true, value: 'card' } },
|
||||
{ key: 'list_card_tag', label: '标签页列表卡片模式', type: 'switch', default: false, dependsOn: { key: 'list_type', not: true, value: 'card' } },
|
||||
{ key: 'list_card_author', label: '用户页列表卡片模式', type: 'switch', default: false, dependsOn: { key: 'list_type', not: true, value: 'card' } },
|
||||
{ key: 'list_card_cat', label: '分类页自定义卡片模式', type: 'taxonomy_select', taxonomy: 'category', multiple: true, default: [], dependsOn: { key: 'list_type', not: true, value: 'card' } },
|
||||
{ key: 'list_list_option', label: '列表模式 UI 配置', type: 'fieldset', default: { style: 'null', img_position: 'left', scale: 70 }, fields: [
|
||||
{ key: 'style', label: '列表样式', type: 'radio', default: 'null', options: [
|
||||
{ label: '默认', value: 'null' }, { label: '样式 2', value: 'style2' },
|
||||
] },
|
||||
{ key: 'img_position', label: '缩略图位置', type: 'radio', default: 'left', options: [
|
||||
{ label: '靠左', value: 'left' }, { label: '靠右', value: 'right' },
|
||||
] },
|
||||
{ key: 'scale', label: '缩略图长宽比例(%)', type: 'number', default: 70, min: 50, max: 200, step: 5 },
|
||||
] },
|
||||
{ key: 'list_card_option', label: '卡片模式 UI 配置', type: 'fieldset', default: { style: 'null', scale: 70 }, fields: [
|
||||
{ key: 'style', label: '卡片样式', type: 'radio', default: 'null', options: [
|
||||
{ label: '默认', value: 'null' }, { label: '样式 3', value: 'style3' },
|
||||
] },
|
||||
{ key: 'scale', label: '缩略图长宽比例(%)', type: 'number', default: 70, min: 20, max: 200, step: 5 },
|
||||
] },
|
||||
{ key: 'mult_thumb_cat', label: '列表多图显示分类', type: 'taxonomy_select', taxonomy: 'category', multiple: true, default: [], help: '文章格式为图片或画廊时默认显示 4 张缩略图;卡片模式或无侧栏时无效。' },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'card',
|
||||
title: '卡片与布局',
|
||||
icon: 'fas fa-th-large',
|
||||
fields: [
|
||||
{
|
||||
key: 'post_card_style',
|
||||
label: '默认列表模式',
|
||||
type: 'select',
|
||||
default: 'thumb',
|
||||
options: [
|
||||
{ label: '列表图文模式', value: 'thumb' },
|
||||
{ label: '列表文字模式', value: 'text' },
|
||||
{ label: '列表自动图文', value: 'thumb_if_has' },
|
||||
{ label: '卡片模式', value: 'card' },
|
||||
{ label: '紧凑列表', value: 'compact' },
|
||||
{ label: '大图列表', value: 'large_thumb' },
|
||||
{ label: '多图列表', value: 'multi_thumb' },
|
||||
],
|
||||
help: '对齐 Zibll list_type:thumb/text/thumb_if_has 为列表,card 为卡片网格。首页可用下方「首页卡片模式」单独强制卡片。',
|
||||
},
|
||||
{ key: 'post_excerpt_length', label: '摘要长度', type: 'number', default: 120, min: 20, max: 500 },
|
||||
{ key: 'post_list_per_page', label: '每页文章数', type: 'number', default: 12, min: 4, max: 48 },
|
||||
{
|
||||
key: 'list_show_type',
|
||||
label: '列表间距样式',
|
||||
type: 'radio',
|
||||
default: 'separate',
|
||||
options: [
|
||||
{ label: '分隔卡片', value: 'separate' },
|
||||
{ label: '无间距', value: 'no_margin' },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'list_list_style',
|
||||
label: '列表样式变体',
|
||||
type: 'radio',
|
||||
default: '',
|
||||
options: [
|
||||
{ label: '默认', value: '' },
|
||||
{ label: '样式2', value: 'style2' },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'list_list_img_position',
|
||||
label: '列表缩略图位置',
|
||||
type: 'radio',
|
||||
default: 'left',
|
||||
options: [
|
||||
{ label: '左侧', value: 'left' },
|
||||
{ label: '右侧', value: 'right' },
|
||||
],
|
||||
},
|
||||
{ key: 'list_list_scale', label: '列表缩略图比例 (%)', type: 'number', default: 70, min: 50, max: 200 },
|
||||
{
|
||||
key: 'list_card_style',
|
||||
label: '卡片样式变体',
|
||||
type: 'radio',
|
||||
default: '',
|
||||
options: [
|
||||
{ label: '默认', value: '' },
|
||||
{ label: '样式3', value: 'style3' },
|
||||
],
|
||||
},
|
||||
{ key: 'list_card_scale', label: '卡片缩略图比例 (%)', type: 'number', default: 70, min: 20, max: 200 },
|
||||
{ key: 'list_card_home', label: '首页卡片模式', type: 'switch', default: false, help: '当默认模式不为卡片时,单独将首页列表强制为卡片(Zibll list_card_home)', dependsOn: { key: 'post_card_style', operator: '!=', value: 'card' } },
|
||||
{
|
||||
key: 'list_card_cat',
|
||||
label: '分类卡片模式',
|
||||
type: 'taxonomy_select',
|
||||
taxonomy: 'category',
|
||||
multiple: true,
|
||||
default: [],
|
||||
},
|
||||
{ key: 'list_card_tag', label: '标签页卡片模式', type: 'switch', default: false },
|
||||
{ key: 'list_card_author', label: '用户页卡片模式', type: 'switch', default: false },
|
||||
key: 'paging', title: '列表翻页', icon: 'fas fa-ellipsis-h', fields: [
|
||||
{ key: 'paging_ajax_s', label: '列表翻页模式', type: 'radio', default: '1', options: [
|
||||
{ label: 'AJAX 追加列表翻页', value: '1' }, { label: '数字翻页按钮', value: '0' },
|
||||
] },
|
||||
{ key: 'paging_ajax_ias_s', label: 'AJAX 自动加载', type: 'switch', default: true, dependsOn: { key: 'paging_ajax_s', value: '1' } },
|
||||
{ key: 'ias_max', label: '自动加载页数', type: 'number', default: 3, min: 0, max: 10, dependsOn: { key: 'paging_ajax_s', value: '1' } },
|
||||
{ key: 'ajax_trigger', label: '翻页按钮文字', type: 'textarea', default: '<i class="fa fa-angle-right"></i>加载更多' },
|
||||
{ key: 'ajax_nomore', label: '列表全部加载完毕文案', type: 'textarea', default: '没有更多内容了' },
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
@@ -19,14 +19,11 @@ export const pageSchema = {
|
||||
post_lightbox_full: true,
|
||||
post_lightbox_down: false,
|
||||
post_lightbox_play: false,
|
||||
post_related_enabled: true,
|
||||
post_related_count: 6,
|
||||
// Display style (Zibll img/list/text). Legacy post_related_type may still hold source or style.
|
||||
post_related_style: 'img',
|
||||
post_related_source: 'category',
|
||||
post_related_type: 'category',
|
||||
post_related_s: true,
|
||||
post_related_type: 'img',
|
||||
related_title: '相关推荐',
|
||||
post_related_n: 6,
|
||||
post_related_orderby: 'views',
|
||||
post_related_title: '相关推荐',
|
||||
breadcrumbs_single_text: true,
|
||||
post_copyright_enabled: true,
|
||||
post_copyright_text: '',
|
||||
@@ -116,26 +113,23 @@ export const pageSchema = {
|
||||
title: '相关推荐',
|
||||
icon: 'fas fa-random',
|
||||
fields: [
|
||||
{ key: 'post_related_enabled', label: '显示相关推荐', type: 'switch', default: true },
|
||||
{ key: 'post_related_count', label: '推荐数量', type: 'number', default: 6, min: 1, max: 20, dependsOn: { key: 'post_related_enabled', value: true } },
|
||||
{ key: 'post_related_style', label: '展示样式', type: 'radio', default: 'img', options: [
|
||||
{ key: 'post_related_s', label: '显示相关推荐', type: 'switch', default: true },
|
||||
{ key: 'post_related_type', label: '展示样式', type: 'radio', default: 'img', options: [
|
||||
{ label: '图文卡片', value: 'img' },
|
||||
{ label: '列表', value: 'list' },
|
||||
{ label: '纯文字', value: 'text' },
|
||||
], dependsOn: { key: 'post_related_enabled', value: true }, help: '对齐 Zibll 相关文章三种样式' },
|
||||
{ key: 'post_related_source', label: '推荐来源', type: 'radio', default: 'category', options: [
|
||||
{ label: '同分类/标签', value: 'category' },
|
||||
{ label: '同标签', value: 'tag' },
|
||||
{ label: '随机', value: 'random' },
|
||||
], dependsOn: { key: 'post_related_enabled', value: true } },
|
||||
], dependsOn: { key: 'post_related_s', value: true }, help: '对齐 Zibll 相关文章三种样式' },
|
||||
{ key: 'related_title', label: '推荐标题', type: 'input', default: '相关推荐', dependsOn: { key: 'post_related_s', value: true } },
|
||||
{ key: 'post_related_n', label: '推荐数量', type: 'number', default: 6, min: 4, max: 12, step: 2, dependsOn: { key: 'post_related_s', value: true } },
|
||||
{ key: 'post_related_orderby', label: '推荐排序', type: 'select', default: 'views', options: [
|
||||
{ label: '浏览量', value: 'views' },
|
||||
{ label: '随机', value: 'rand' },
|
||||
{ label: '相关度', value: 'relevance' },
|
||||
{ label: '时间', value: 'date' },
|
||||
{ label: '更新时间', value: 'modified' },
|
||||
], dependsOn: { key: 'post_related_enabled', value: true } },
|
||||
{ key: 'post_related_title', label: '推荐标题', type: 'input', default: '相关推荐', dependsOn: { key: 'post_related_enabled', value: true } },
|
||||
{ label: '发布时间', value: 'date' },
|
||||
{ label: '浏览量', value: 'views' },
|
||||
{ label: '点赞量', value: 'like' },
|
||||
{ label: '评论量', value: 'comment_count' },
|
||||
{ label: '收藏数量', value: 'favorite' },
|
||||
{ label: '随机', value: 'rand' },
|
||||
], dependsOn: { key: 'post_related_s', value: true } },
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
@@ -1,22 +1,23 @@
|
||||
/** Zibll 9.0 list-thumbnail settings. */
|
||||
const themeRoot = typeof window !== 'undefined' && window.aksrtAdminData?.themeUri
|
||||
? String(window.aksrtAdminData.themeUri).replace(/\/$/, '')
|
||||
: ''
|
||||
const spareThumbnailDefault = [{ img: `${themeRoot}/assets/img/thumbnail.svg` }]
|
||||
|
||||
export const thumbSchema = {
|
||||
key: 'post_list.thumb',
|
||||
title: '列表缩略图',
|
||||
icon: 'fas fa-images',
|
||||
description: '配置缩略图来源优先级、尺寸、占位图和多图模式。',
|
||||
description: '缩略图获取优先级:文章特色图像 > 外链特色图像 > 文章首图 > 分类封面图 > 备用缩略图 > 懒加载预载图。',
|
||||
defaults: {
|
||||
thumb_priority: 'featured,attachment,resource,custom',
|
||||
thumb_fallback: 'placeholder',
|
||||
thumb_spare_images: [],
|
||||
thumb_aspect_ratio: '16:9',
|
||||
list_thumb_fit: 'cover',
|
||||
thumb_multi_enabled: false,
|
||||
thumb_multi_count: 3,
|
||||
list_thumb_slides_s: true,
|
||||
list_thumb_video_s: true,
|
||||
list_thumb_video_mute_s: true,
|
||||
thumb_postfirstimg_s: true,
|
||||
thumb_catimg_s: true,
|
||||
mult_thumb_cat: [],
|
||||
list_thumb_fit: '',
|
||||
thumb_postfirstimg_size: 'medium',
|
||||
spare_thumbnail: spareThumbnailDefault,
|
||||
},
|
||||
groups: [
|
||||
{
|
||||
@@ -24,44 +25,24 @@ export const thumbSchema = {
|
||||
title: '图片来源',
|
||||
icon: 'fas fa-image',
|
||||
fields: [
|
||||
{ key: 'thumb_priority', label: '图片优先级', type: 'input', default: 'featured,attachment,resource,custom', help: '逗号分隔: featured(特色图), attachment(附件), resource(资源封面), custom(自定义), post_first_img(文章首图), category_cover(分类封面)' },
|
||||
{ key: 'thumb_fallback', label: '无图时处理', type: 'radio', default: 'placeholder', options: [
|
||||
{ label: '显示占位图', value: 'placeholder' },
|
||||
{ label: '隐藏缩略图', value: 'hide' },
|
||||
{ label: '随机封面', value: 'random' },
|
||||
]},
|
||||
{ key: 'thumb_spare_images', label: '备用缩略图', type: 'gallery', default: [], help: '当无图处理选择"随机封面"时从此图库随机选取', dependsOn: { key: 'thumb_fallback', value: 'random' } },
|
||||
{ key: 'thumb_aspect_ratio', label: '图片比例', type: 'select', default: '16:9', options: [
|
||||
{ label: '16:9 宽屏', value: '16:9' },
|
||||
{ label: '4:3 标准', value: '4:3' },
|
||||
{ label: '1:1 正方形', value: '1:1' },
|
||||
{ label: '自适应', value: 'auto' },
|
||||
]},
|
||||
{ key: 'list_thumb_fit', label: '缩略图填充方式', type: 'radio', default: 'cover', options: [
|
||||
{ label: '填充裁剪', value: 'cover' },
|
||||
{ label: '完整显示', value: 'contain' },
|
||||
]},
|
||||
{ key: 'list_thumb_slides_s', label: '幻灯片缩略图', type: 'switch', default: true, help: '允许幻灯片作为列表缩略图' },
|
||||
{ key: 'list_thumb_video_s', label: '视频缩略图', type: 'switch', default: true, help: '鼠标悬停时自动播放视频缩略图' },
|
||||
{ key: 'list_thumb_video_mute_s', label: '视频缩略图静音', type: 'switch', default: true, dependsOn: { key: 'list_thumb_video_s', value: true }, help: '视频缩略图播放时静音' },
|
||||
{ key: 'thumb_postfirstimg_s', label: '自动获取文章首图', type: 'switch', default: true, help: '自动从文章内容中提取第一张图片作为缩略图' },
|
||||
{ key: 'thumb_postfirstimg_size', label: '首图尺寸', type: 'select', default: 'medium', options: [
|
||||
{ label: '缩略图', value: 'thumbnail' },
|
||||
{ label: '中等', value: 'medium' },
|
||||
{ label: '大', value: 'large' },
|
||||
{ label: '原始', value: 'full' },
|
||||
], dependsOn: { key: 'thumb_postfirstimg_s', value: true }, help: '自动获取文章首图时使用的 WP 图片尺寸' },
|
||||
{ key: 'thumb_catimg_s', label: '自动获取分类封面', type: 'switch', default: true, help: '无特色图时使用分类封面图作为缩略图' },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'multi',
|
||||
title: '多图模式',
|
||||
icon: 'fas fa-images',
|
||||
fields: [
|
||||
{ key: 'thumb_multi_enabled', label: '多图卡片', type: 'switch', default: false, help: '当文章有多张图片时,在列表中展示多图预览' },
|
||||
{ key: 'thumb_multi_count', label: '最多显示几张', type: 'number', default: 3, min: 2, max: 6, dependsOn: { key: 'thumb_multi_enabled', value: true } },
|
||||
{ key: 'mult_thumb_cat', label: '按分类多图显示', type: 'taxonomy_select', taxonomy: 'category', multiple: true, default: [], help: '选择的分类下所有文章自动显示多张缩略图' },
|
||||
{ key: 'list_thumb_slides_s', label: '幻灯片缩略图', type: 'switch', default: true, help: '允许设置幻灯片为列表缩略图' },
|
||||
{ key: 'list_thumb_video_s', label: '视频缩略图', type: 'switch', default: true, help: '鼠标移动到列表上自动播放' },
|
||||
{ key: 'list_thumb_video_mute_s', label: '视频缩略图静音播放', type: 'switch', default: true, dependsOn: { key: 'list_thumb_video_s', value: true }, help: '部分手机浏览器无法实现静音播放' },
|
||||
{ key: 'thumb_postfirstimg_s', label: '自动获取文章首图', type: 'switch', default: true },
|
||||
{ key: 'thumb_catimg_s', label: '自动获取分类封面', type: 'switch', default: true },
|
||||
{ key: 'list_thumb_fit', label: '缩略图填充方式', type: 'radio', default: '', options: [
|
||||
{ label: 'cover 铺满', value: '' },
|
||||
{ label: 'contain 等比例缩放', value: 'contain' },
|
||||
] },
|
||||
{ key: 'thumb_postfirstimg_size', label: '缩略图大小', type: 'radio', default: 'medium', options: [
|
||||
{ label: '小尺寸', value: 'thumbnail' },
|
||||
{ label: '中尺寸', value: 'medium' },
|
||||
{ label: '大尺寸', value: 'large' },
|
||||
{ label: '原图', value: 'full' },
|
||||
] },
|
||||
{ key: 'spare_thumbnail', label: '备用缩略图', type: 'repeater', default: spareThumbnailDefault, addText: '添加备用缩略图', fields: [
|
||||
{ key: 'img', label: '图片', type: 'media', default: '' },
|
||||
], help: '添加多张图片时自动随机获取' },
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
Reference in new issue
Block a user