feat(branding): default both site logos to assets/img/logo.png
- Point 站点 Logo / 暗色模式 Logo schema defaults (PHP + VUE) and the Settings::logo_url() fallback at assets/img/logo.png. - Point the footer night image default at the same file. - Remove logo_dark.png and the now-unreferenced assets/icons/default-logo.svg along with the private default_asset_url() helper that was its only reader. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
1dfcc38a83
commit
6bcfbfb252
7 files changed
+11
-24
No files matched your search
@@ -156,8 +156,8 @@ class GlobalSchema {
|
||||
'option_key' => 'jio_settings',
|
||||
'groups' => [
|
||||
['key' => 'logo', 'title' => 'Logo 设置', 'fields' => [
|
||||
['key' => 'site_logo', 'label' => '站点 Logo', 'type' => 'media', 'default' => ''],
|
||||
['key' => 'site_logo_dark', 'label' => '暗色模式 Logo', 'type' => 'media', 'default' => ''],
|
||||
['key' => 'site_logo', 'label' => '站点 Logo', 'type' => 'media', 'default' => get_template_directory_uri() . '/assets/img/logo.png'],
|
||||
['key' => 'site_logo_dark', 'label' => '暗色模式 Logo', 'type' => 'media', 'default' => get_template_directory_uri() . '/assets/img/logo.png'],
|
||||
['key' => 'logo_text', 'label' => 'Logo 文字', 'type' => 'input', 'default' => ''],
|
||||
]],
|
||||
['key' => 'favicon', 'title' => '站点图标', 'fields' => [
|
||||
|
||||
@@ -83,7 +83,7 @@ class SchemaPageDisplay {
|
||||
self::field('fcode_template', '页脚布局模板选择', 'image_select', 'template_1', ['previewWidth' => 240, 'options' => [['label' => '模板一', 'value' => 'template_1', 'image' => self::asset('assets/images/footer/fcode_template_1.png')]]]),
|
||||
self::field('footer_t1_m_s', '版块一移动端显示', 'switcher', false),
|
||||
self::field('footer_t1_img', '日间模式图片', 'upload', $img . 'logo.png'),
|
||||
self::field('footer_t1_img_dark', '夜间模式图片', 'upload', $img . 'logo_dark.png'),
|
||||
self::field('footer_t1_img_dark', '夜间模式图片', 'upload', $img . 'logo.png'),
|
||||
self::field('footer_t1_t', '首行文字', 'text', ''),
|
||||
self::field('fcode_t1_code', '更多内容', 'textarea', 'Jio 主题专为博客、自媒体、资讯类的网站设计开发,简约优雅的设计风格,全面的前端用户功能,简单的模块化配置,欢迎您的体验', ['sanitize_type' => 'html', 'rows' => 3]),
|
||||
self::field('fcode_t2_code_1', '版块二第一行', 'textarea', '<a href="#">友链申请</a>' . "\n" . '<a href="#">免责声明</a>' . "\n" . '<a href="#">广告合作</a>' . "\n" . '<a href="#">关于我们</a>', ['sanitize_type' => 'html', 'rows' => 4]),
|
||||
|
||||
@@ -20,15 +20,10 @@ trait AuthReader {
|
||||
return !self::close_signup();
|
||||
}
|
||||
|
||||
/** 主题内置默认图片 URL */
|
||||
private static function default_asset_url(string $filename): string {
|
||||
return get_template_directory_uri() . '/assets/icons/' . $filename;
|
||||
}
|
||||
|
||||
/** 获取 Logo URL(留空时使用内置默认) */
|
||||
public static function logo_url(): string {
|
||||
$url = trim((string) self::get_value('site_logo', ''));
|
||||
return $url !== '' ? $url : self::default_asset_url('default-logo.svg');
|
||||
return $url !== '' ? $url : get_template_directory_uri() . '/assets/img/logo.png';
|
||||
}
|
||||
|
||||
/** 获取暗色模式 Logo URL(留空时跟随浅色模式) */
|
||||
|
||||
Reference in new issue
Block a user