feat(share): align social sharing runtime
This commit is contained in:
@@ -371,6 +371,42 @@ class GlobalSchema {
|
||||
]],
|
||||
],
|
||||
],
|
||||
'share' => [
|
||||
'key' => 'share',
|
||||
'title' => '社交分享',
|
||||
'version' => '1.0.0',
|
||||
'option_key' => 'aksrt_settings',
|
||||
'groups' => [[
|
||||
'key' => 'share',
|
||||
'title' => '社交分享',
|
||||
'fields' => [
|
||||
['key' => 'share_s', 'label' => '文章分享功能', 'type' => 'switcher', 'default' => true, 'help' => '关闭后,在文章页面将不显示分享按钮。'],
|
||||
['key' => 'share_items', 'label' => '分享平台', 'type' => 'custom', 'renderer' => 'sorter', 'sanitize_type' => 'array', 'default' => [
|
||||
'enabled' => ['qzone' => 'QQ空间', 'weibo' => '微博', 'qq' => 'QQ好友', 'poster' => '海报分享', 'copy' => '复制链接'],
|
||||
'disabled' => ['facebook' => 'Facebook', 'twitter' => 'X', 'telegram' => 'Telegram', 'whatsapp' => 'WhatsApp', 'linkedin' => 'LinkedIn', 'reddit' => 'Reddit', 'line' => 'LINE', 'vk' => 'VK', 'email' => '邮件'],
|
||||
], 'options' => [
|
||||
['label' => 'QQ空间', 'value' => 'qzone'], ['label' => '微博', 'value' => 'weibo'], ['label' => 'QQ好友', 'value' => 'qq'],
|
||||
['label' => 'Facebook', 'value' => 'facebook'], ['label' => 'X', 'value' => 'twitter'], ['label' => 'Telegram', 'value' => 'telegram'],
|
||||
['label' => 'WhatsApp', 'value' => 'whatsapp'], ['label' => 'LinkedIn', 'value' => 'linkedin'], ['label' => 'Reddit', 'value' => 'reddit'],
|
||||
['label' => 'LINE', 'value' => 'line'], ['label' => 'VK', 'value' => 'vk'], ['label' => '邮件', 'value' => 'email'],
|
||||
['label' => '海报分享', 'value' => 'poster'], ['label' => '复制链接', 'value' => 'copy'],
|
||||
], 'description' => '左侧启用并拖拽排序,右侧为未启用项(同时启用的数量不建议超过 6 个)。若开启海外平台,用户网络必须能正常访问对应服务。'],
|
||||
['key' => 'wechat_share_s', 'label' => '微信分享有图', 'type' => 'switcher', 'default' => false, 'help' => '使用微信 JSAPI 在微信 App 内分享。'],
|
||||
['key' => 'wechat_share_hint', 'label' => '', 'type' => 'content', 'ui_only' => true, 'dependsOn' => ['key' => 'wechat_share_s', 'value' => true], 'content' => '<p><strong>微信分享有图配置</strong></p><p>此功能用于用户从公众号进入页面后调用微信默认分享能力,并不会额外显示分享按钮。请在公众号后台将当前站点域名配置为 JS 接口安全域名。</p><p><a href="https://mp.weixin.qq.com/" target="_blank" rel="noopener noreferrer">前往微信公众平台</a></p>'],
|
||||
['key' => 'wechat_share_option', 'label' => '微信分享有图配置', 'type' => 'fieldset', 'default' => ['appid' => '', 'app_secret' => '', 'only_logo' => false], 'dependsOn' => ['key' => 'wechat_share_s', 'value' => true], 'fields' => [
|
||||
['key' => 'appid', 'label' => 'AppID', 'type' => 'input', 'default' => ''],
|
||||
['key' => 'app_secret', 'label' => 'AppSecret', 'type' => 'input', 'default' => ''],
|
||||
['key' => 'only_logo', 'label' => '全部使用网站图标', 'type' => 'switcher', 'default' => false, 'help' => '默认自动使用页面封面图;开启后所有页面均使用网站图标。图片启用防盗链时建议开启。'],
|
||||
]],
|
||||
['key' => 'share_img', 'label' => '生成海报分享', 'type' => 'switcher', 'default' => true, 'help' => '网站图片使用 OSS 等云存储时,请先配置允许本站 Canvas 读取图片的跨域规则。'],
|
||||
['key' => 'share_img_warning', 'label' => '', 'type' => 'notice', 'ui_only' => true, 'alertType' => 'warning', 'content' => '海报图片加载失败时,请检查图片 CDN/OSS 的跨域响应头。', 'dependsOn' => ['key' => 'share_img', 'value' => true]],
|
||||
['key' => 'share_img_compatible_s', 'label' => '海报分享兼容模式', 'type' => 'switcher', 'default' => false, 'dependsOn' => ['key' => 'share_img', 'value' => true], 'help' => '通过服务端代理读取海报图片,改善跨域兼容性;会增加服务器图片处理开销。'],
|
||||
['key' => 'share_img_byimg', 'label' => '海报分享默认图片', 'type' => 'media', 'default' => get_template_directory_uri() . '/assets/img/slider-bg.jpg', 'dependsOn' => ['key' => 'share_img', 'value' => true], 'help' => '文章没有图片时使用,建议尺寸 800×500。'],
|
||||
['key' => 'share_logo', 'label' => '海报分享 LOGO', 'type' => 'media', 'default' => get_template_directory_uri() . '/assets/img/logo.png', 'dependsOn' => ['key' => 'share_img', 'value' => true], 'help' => '显示在海报底部,建议尺寸 300×100、大小 50KB 以内。'],
|
||||
['key' => 'share_desc', 'label' => '海报分享底部文案', 'type' => 'input', 'default' => '扫一扫 立即查看', 'dependsOn' => ['key' => 'share_img', 'value' => true]],
|
||||
],
|
||||
]],
|
||||
],
|
||||
'email' => \AKSRT\Settings\MailTemplates::build_schema(),
|
||||
'custom-code' => [
|
||||
'key' => 'custom-code',
|
||||
|
||||
Reference in New Issue
Block a user