Compare commits
5
Commits
d9946a3da4
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e4f22f3226 | ||
|
|
92dd119dd7 | ||
|
|
d7f545bd23 | ||
|
|
981ea44d5e | ||
|
|
5d60409903 |
@@ -0,0 +1,25 @@
|
||||
# MING 明命项目 Agent 说明
|
||||
|
||||
## 发布规则
|
||||
|
||||
- 当前主题版本以 `ming-theme/style.css` 的 `Version` 和 `ming-theme/functions.php` 的 `MING_VERSION` 为准,两者必须一致。
|
||||
- 每次发布必须同步更新本文件、仓库根目录 `README.md` 的版本记录,以及 `ming-theme/ROADMAP.md` 的当前版本。
|
||||
- 发布前执行 `./scripts/package-theme.sh`,确认 `dist/ming-theme.zip` 含有顶层 `ming-theme/` 目录。
|
||||
- 不得将账号、密码、Cookie、令牌、生产配置或私有部署资料提交到 Git。
|
||||
|
||||
## 版本更新记录
|
||||
|
||||
| 版本 | 更新内容 |
|
||||
|---|---|
|
||||
| 1.2.4 | 品牌页面、电商页面与新品投票系统的功能基线。 |
|
||||
| 1.5.2 | 订单页增加 BACS 汇款信息卡;重构未登录会员中心为双卡片布局。 |
|
||||
| 1.5.3 | 增加移动端汉堡按钮与全屏抽屉导航。 |
|
||||
| 1.5.4 | 优化已登录会员中心的移动端导航与内容布局。 |
|
||||
| 1.5.5 | 修复移动端订单列表数据被最小宽度挤出屏幕的问题。 |
|
||||
| 1.5.6 | 字体改为本地托管的 Noto TC 字体子集,移除 Google Fonts 外链并精简字重。 |
|
||||
| 1.6.0 | 增加首页宣传片、站内商品搜索、三栏页脚与启用主题时的信息页初始化。 |
|
||||
| 1.7.0 | 增加 OG/Twitter 分享标签、许愿分享、品牌专栏、SKU/色卡体系与海报生成器;同步修复视频、库存与移动端布局。 |
|
||||
| 1.7.1 | 协调移动端字体与断行,修复变体库存状态、色卡属性与投票商品过滤。 |
|
||||
| 1.7.2 | 修复分享按钮的 `hidden` 状态、色点点击换图/跳转及移动端页脚三栏布局。 |
|
||||
| 1.7.3 | 当前主题源码整理与 Git 仓库基线版本;未发现独立的功能变更记录。 |
|
||||
| 1.7.4 | 字体、SVG 文字与分享语言标识改为跟随 WordPress 后台“站点语言”:繁中使用自托管 TC 字体,简中、日文、韩文及其他语言使用相应字型回退。 |
|
||||
@@ -25,6 +25,27 @@ dist/ 生成的主题 ZIP;不进入 Git
|
||||
|
||||
产物为 `dist/ming-theme.zip`,其中包含顶层 `ming-theme/` 目录。
|
||||
|
||||
## 版本与更新记录
|
||||
|
||||
主题当前版本为 **1.7.4**。主题版本必须同时更新 `ming-theme/style.css` 的 `Version` 和 `ming-theme/functions.php` 的 `MING_VERSION`;前者供 WordPress 识别主题版本,后者用于 CSS、JS 与字体资源的缓存刷新。
|
||||
|
||||
| 版本 | 更新内容 |
|
||||
|---|---|
|
||||
| 1.2.4 | 品牌页面、电商页面与新品投票系统的功能基线。 |
|
||||
| 1.5.2 | 订单页增加 BACS 汇款信息卡;重构未登录会员中心为双卡片布局。 |
|
||||
| 1.5.3 | 增加移动端汉堡按钮与全屏抽屉导航。 |
|
||||
| 1.5.4 | 优化已登录会员中心的移动端导航与内容布局。 |
|
||||
| 1.5.5 | 修复移动端订单列表数据被最小宽度挤出屏幕的问题。 |
|
||||
| 1.5.6 | 字体改为本地托管的 Noto TC 字体子集,移除 Google Fonts 外链并精简字重。 |
|
||||
| 1.6.0 | 增加首页宣传片、站内商品搜索、三栏页脚与启用主题时的信息页初始化。 |
|
||||
| 1.7.0 | 增加 OG/Twitter 分享标签、许愿分享、品牌专栏、SKU/色卡体系与海报生成器;同步修复视频、库存与移动端布局。 |
|
||||
| 1.7.1 | 协调移动端字体与断行,修复变体库存状态、色卡属性与投票商品过滤。 |
|
||||
| 1.7.2 | 修复分享按钮的 `hidden` 状态、色点点击换图/跳转及移动端页脚三栏布局。 |
|
||||
| 1.7.3 | 当前主题源码整理与 Git 仓库基线版本;未发现独立的功能变更记录。 |
|
||||
| 1.7.4 | 字体、SVG 文字与分享语言标识改为跟随 WordPress 后台“站点语言”:繁中使用自托管 TC 字体,简中、日文、韩文及其他语言使用相应字型回退。 |
|
||||
|
||||
每次发布必须:更新上述两处版本号、在本表和项目 Agent 文档记录变更、提交 Git、重新打包并验证主题包。
|
||||
|
||||
## 重要约束
|
||||
|
||||
- 不提交后台密码、Cookie、API 密钥、生产配置或本地运维交接材料。
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# ROADMAP.md — MING 明命 项目路线图
|
||||
|
||||
> 当前源码版本:ming-theme **v1.7.3**
|
||||
> 当前源码版本:ming-theme **v1.7.4**
|
||||
> 最后更新:2026-09
|
||||
|
||||
---
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* MING 明命 — 自托管字体(v1.5.6 起替代 Google Fonts 外链)
|
||||
来源:google/fonts(OFL 授权),经子集化(Big5 常用字 + 全形标点)与字重实例化 */
|
||||
/* MING 明命 — 自托管字體(v1.5.6 起替代 Google Fonts 外鏈)
|
||||
繁體中文站點使用下列 TC 字型;其他站點語言由主題選用對應系統字型。
|
||||
來源:google/fonts(OFL 授權),經子集化(Big5 常用字 + 全形標點)與字重實例化。 */
|
||||
|
||||
@font-face {
|
||||
font-family: 'Cormorant Garamond';
|
||||
|
||||
@@ -8,9 +8,10 @@
|
||||
--ink:#2B2B26;
|
||||
--muted:#7A756A;
|
||||
--line:rgba(43,43,38,.16);
|
||||
--serif:'Noto Serif TC',serif;
|
||||
--latin:'Cormorant Garamond','Noto Serif TC',serif;
|
||||
--sans:'Noto Sans TC',sans-serif;
|
||||
/* WordPress 依站點語言於前台覆寫下列字型堆疊。 */
|
||||
--serif:Georgia,'Times New Roman',serif;
|
||||
--latin:'Cormorant Garamond',Georgia,'Times New Roman',serif;
|
||||
--sans:system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
|
||||
}
|
||||
*{margin:0;padding:0;box-sizing:border-box}
|
||||
html{scroll-behavior:smooth}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 695 B |
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 51 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 5.6 KiB |
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 19 KiB |
@@ -39,7 +39,7 @@ $ming_mailto = $ming_email ? $ming_email : 'hello@ming.example';
|
||||
<?php endif; ?>
|
||||
<?php if ( $ming_line ) : ?>
|
||||
<a href="<?php echo esc_url( $ming_line ); ?>" target="_blank" rel="noopener" aria-label="LINE" title="LINE">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M12 4C7 4 3 6.9 3 10.6c0 3.3 2.9 6 6.8 6.6.3.1.7.2.8.5.1.2.1.6 0 .9l-.4 1.3c0 .2-.1.6.5.4.6-.3 3.3-2 4.5-2.7 2.9-1.3 4.8-3.6 4.8-7C21 6.9 17 4 12 4z"/><text x="12" y="13" text-anchor="middle" font-size="5.2" font-weight="600" fill="currentColor" stroke="none" font-family="sans-serif" letter-spacing=".5">LINE</text></svg>
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" style="font-family:var(--sans)"><path d="M12 4C7 4 3 6.9 3 10.6c0 3.3 2.9 6 6.8 6.6.3.1.7.2.1.6 0 .9l-.4 1.3c0 .2-.1.6.5.4.6-.3 3.3-2 4.5-2.7 2.9-1.3 4.8-3.6 4.8-7C21 6.9 17 4 12 4z"/><text x="12" y="13" text-anchor="middle" font-size="5.2" font-weight="600" fill="currentColor" stroke="none" letter-spacing=".5">LINE</text></svg>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
+120
-3
@@ -9,7 +9,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
define( 'MING_VERSION', '1.7.3' );
|
||||
define( 'MING_VERSION', '1.7.4' );
|
||||
|
||||
/**
|
||||
* Theme setup.
|
||||
@@ -52,6 +52,66 @@ function ming_setup() {
|
||||
}
|
||||
add_action( 'after_setup_theme', 'ming_setup' );
|
||||
|
||||
/**
|
||||
* Return the site's WordPress locale in a form suitable for comparisons.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function ming_site_locale() {
|
||||
return strtolower( str_replace( '-', '_', get_locale() ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Build font stacks for the language selected in WordPress settings.
|
||||
*
|
||||
* Self-hosted TC font files are used for Traditional Chinese. Other site
|
||||
* languages use the appropriate platform font stack and do not request a
|
||||
* Chinese Traditional web font.
|
||||
*
|
||||
* @return string CSS custom-property declarations.
|
||||
*/
|
||||
function ming_font_stack_css() {
|
||||
$locale = ming_site_locale();
|
||||
$fonts = array(
|
||||
'sans' => "system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
||||
'serif' => "Georgia, 'Times New Roman', serif",
|
||||
'latin' => "'Cormorant Garamond', Georgia, 'Times New Roman', serif",
|
||||
);
|
||||
|
||||
if ( preg_match( '/^zh_(?:hant(?:_|$)|tw(?:_|$)|hk(?:_|$)|mo(?:_|$))/', $locale ) ) {
|
||||
$fonts = array(
|
||||
'sans' => "'Noto Sans TC', 'Noto Sans CJK TC', 'PingFang TC', 'Microsoft JhengHei', 'Heiti TC', sans-serif",
|
||||
'serif' => "'Noto Serif TC', 'Noto Serif CJK TC', 'Songti TC', 'PMingLiU', 'MingLiU', serif",
|
||||
'latin' => "'Cormorant Garamond', 'Noto Serif TC', 'Noto Serif CJK TC', 'Songti TC', serif",
|
||||
);
|
||||
} elseif ( preg_match( '/^zh_/', $locale ) ) {
|
||||
$fonts = array(
|
||||
'sans' => "'Noto Sans SC', 'Noto Sans CJK SC', 'PingFang SC', 'Microsoft YaHei', 'Heiti SC', sans-serif",
|
||||
'serif' => "'Noto Serif SC', 'Noto Serif CJK SC', 'Songti SC', SimSun, serif",
|
||||
'latin' => "'Cormorant Garamond', 'Noto Serif SC', 'Noto Serif CJK SC', 'Songti SC', serif",
|
||||
);
|
||||
} elseif ( preg_match( '/^ja(?:_|$)/', $locale ) ) {
|
||||
$fonts = array(
|
||||
'sans' => "'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', Meiryo, sans-serif",
|
||||
'serif' => "'Noto Serif JP', 'Hiragino Mincho ProN', 'Yu Mincho', serif",
|
||||
'latin' => "'Cormorant Garamond', 'Noto Serif JP', 'Hiragino Mincho ProN', serif",
|
||||
);
|
||||
} elseif ( preg_match( '/^ko(?:_|$)/', $locale ) ) {
|
||||
$fonts = array(
|
||||
'sans' => "'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif",
|
||||
'serif' => "'Noto Serif KR', AppleMyungjo, Batang, serif",
|
||||
'latin' => "'Cormorant Garamond', 'Noto Serif KR', AppleMyungjo, serif",
|
||||
);
|
||||
}
|
||||
|
||||
return sprintf(
|
||||
":root {\n\t--serif: %1\$s;\n\t--latin: %2\$s;\n\t--sans: %3\$s;\n}\n",
|
||||
$fonts['serif'],
|
||||
$fonts['latin'],
|
||||
$fonts['sans']
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Enqueue assets.
|
||||
*/
|
||||
@@ -65,6 +125,7 @@ function ming_assets() {
|
||||
);
|
||||
|
||||
wp_enqueue_style( 'ming-main', get_template_directory_uri() . '/assets/css/main.css', array( 'ming-fonts' ), MING_VERSION );
|
||||
wp_add_inline_style( 'ming-main', ming_font_stack_css() );
|
||||
wp_enqueue_script( 'ming-main', get_template_directory_uri() . '/assets/js/main.js', array(), MING_VERSION, true );
|
||||
|
||||
// Pass image directory to JS (product grid).
|
||||
@@ -91,7 +152,12 @@ add_action( 'wp_enqueue_scripts', 'ming_assets' );
|
||||
* Theme favicon.
|
||||
*/
|
||||
function ming_favicon() {
|
||||
echo '<link rel="icon" type="image/png" href="' . esc_url( get_template_directory_uri() . '/assets/img/logo-mark.png' ) . '">' . "\n";
|
||||
$asset_uri = get_template_directory_uri() . '/assets/img/';
|
||||
|
||||
echo '<link rel="icon" href="' . esc_url( $asset_uri . 'favicon.ico' ) . '" sizes="any">' . "\n";
|
||||
echo '<link rel="icon" type="image/svg+xml" href="' . esc_url( $asset_uri . 'favicon.svg' ) . '">' . "\n";
|
||||
echo '<link rel="icon" type="image/png" sizes="32x32" href="' . esc_url( $asset_uri . 'favicon-32.png' ) . '">' . "\n";
|
||||
echo '<link rel="apple-touch-icon" sizes="180x180" href="' . esc_url( $asset_uri . 'apple-touch-icon.png' ) . '">' . "\n";
|
||||
}
|
||||
add_action( 'wp_head', 'ming_favicon' );
|
||||
|
||||
@@ -734,6 +800,57 @@ add_action( 'after_switch_theme', 'ming_seed_footer_content' );
|
||||
* ==========================================================*/
|
||||
|
||||
/* ---------- OG / Twitter 分享標籤 ---------- */
|
||||
/**
|
||||
* Return an Open Graph locale derived from the WordPress site language.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function ming_og_locale() {
|
||||
$locale = ming_site_locale();
|
||||
|
||||
if ( 0 === strpos( $locale, 'zh_' ) ) {
|
||||
if ( preg_match( '/(?:hk)/', $locale ) ) {
|
||||
return 'zh_HK';
|
||||
}
|
||||
if ( preg_match( '/(?:mo)/', $locale ) ) {
|
||||
return 'zh_MO';
|
||||
}
|
||||
|
||||
return preg_match( '/(?:hant|tw)/', $locale ) ? 'zh_TW' : 'zh_CN';
|
||||
}
|
||||
|
||||
$parts = explode( '_', $locale );
|
||||
$language = isset( $parts[0] ) ? $parts[0] : 'en';
|
||||
$region = '';
|
||||
foreach ( array_reverse( $parts ) as $part ) {
|
||||
if ( 2 === strlen( $part ) && ctype_alpha( $part ) ) {
|
||||
$region = strtoupper( $part );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $region ) {
|
||||
return $language . '_' . $region;
|
||||
}
|
||||
|
||||
$default_regions = array(
|
||||
'ar' => 'SA',
|
||||
'de' => 'DE',
|
||||
'en' => 'US',
|
||||
'es' => 'ES',
|
||||
'fr' => 'FR',
|
||||
'it' => 'IT',
|
||||
'ja' => 'JP',
|
||||
'ko' => 'KR',
|
||||
'nl' => 'NL',
|
||||
'pl' => 'PL',
|
||||
'pt' => 'BR',
|
||||
'ru' => 'RU',
|
||||
);
|
||||
|
||||
return isset( $default_regions[ $language ] ) ? $language . '_' . $default_regions[ $language ] : 'en_US';
|
||||
}
|
||||
|
||||
add_action( 'wp_head', 'ming_og_tags', 5 );
|
||||
function ming_og_tags() {
|
||||
if ( is_admin() || ( function_exists( 'is_embed' ) && is_embed() ) ) { return; }
|
||||
@@ -779,7 +896,7 @@ function ming_og_tags() {
|
||||
echo '<meta property="og:description" content="' . esc_attr( $desc ) . '">' . "\n";
|
||||
echo '<meta property="og:url" content="' . esc_url( $url ) . '">' . "\n";
|
||||
echo '<meta property="og:type" content="' . esc_attr( $type ) . '">' . "\n";
|
||||
echo '<meta property="og:locale" content="zh_TW">' . "\n";
|
||||
echo '<meta property="og:locale" content="' . esc_attr( ming_og_locale() ) . '">' . "\n";
|
||||
if ( $image ) {
|
||||
echo '<meta property="og:image" content="' . esc_url( $image ) . '">' . "\n";
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ Theme URI: https://ming.example
|
||||
Author: MING 明命
|
||||
Author URI: https://ming.example
|
||||
Description: MING 明命品牌官網主題 —— 陶瓷內膽杯 · 明亮生命 自然連結。單頁式品牌首頁,支援 WooCommerce 商城、會員中心、購物車角標、社群連結與公司資訊自訂。
|
||||
Version: 1.7.3
|
||||
Version: 1.7.4
|
||||
Requires at least: 6.0
|
||||
Tested up to: 6.7
|
||||
Requires PHP: 7.4
|
||||
|
||||
@@ -65,7 +65,7 @@ get_header();
|
||||
<h3>太陽與光</h3><p>光明溫暖,<br>希望明亮。</p>
|
||||
</div>
|
||||
<div class="symbol">
|
||||
<svg viewBox="0 0 64 64"><circle cx="32" cy="32" r="22"/><text x="32" y="28" text-anchor="middle" font-size="15" fill="var(--green)" stroke="none" font-family="'Noto Serif TC',serif">明</text><text x="32" y="48" text-anchor="middle" font-size="15" fill="var(--green)" stroke="none" font-family="'Noto Serif TC',serif">命</text></svg>
|
||||
<svg viewBox="0 0 64 64" style="font-family:var(--serif)"><circle cx="32" cy="32" r="22"/><text x="32" y="28" text-anchor="middle" font-size="15" fill="var(--green)" stroke="none">明</text><text x="32" y="48" text-anchor="middle" font-size="15" fill="var(--green)" stroke="none">命</text></svg>
|
||||
<h3>明・命</h3><p>生命因光而明,<br>萬物因自然而生。</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user