11---
22/**
33 * 博客文章开头广告组件
4- * 在博客文章标题之后、正文之前显示 GLM 推广卡片
4+ * 在博客文章标题之后、正文之前显示 GLM 和阿里云推广卡片
55 */
6- import { GLM_PROMO_LINKS } from ' @shared/links' ;
6+ import { GLM_PROMO_LINKS , ALIYUN_PROMO_LINKS } from ' @shared/links' ;
77
88interface Props {
99 /** 是否隐藏广告 */
@@ -18,47 +18,90 @@ if (hideAd) {
1818}
1919
2020const { glmCoding } = GLM_PROMO_LINKS ;
21+ const { aistar } = ALIYUN_PROMO_LINKS ;
2122---
2223
23- <div class =" blog-header-ad" >
24- <div class =" ad-icon" >
25- <svg xmlns =" http://www.w3.org/2000/svg" width =" 20" height =" 20" viewBox =" 0 0 24 24" fill =" none" stroke =" currentColor" stroke-width =" 2" stroke-linecap =" round" stroke-linejoin =" round" >
26- <path d =" M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z" />
27- <path d =" m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z" />
28- <path d =" M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0" />
29- <path d =" M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5" />
30- </svg >
24+ <div class =" blog-header-ad-container" >
25+ <!-- GLM 推广卡片 -->
26+ <div class =" blog-header-ad" >
27+ <div class =" ad-icon" >
28+ <svg xmlns =" http://www.w3.org/2000/svg" width =" 20" height =" 20" viewBox =" 0 0 24 24" fill =" none" stroke =" currentColor" stroke-width =" 2" stroke-linecap =" round" stroke-linejoin =" round" >
29+ <path d =" M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z" />
30+ <path d =" m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z" />
31+ <path d =" M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0" />
32+ <path d =" M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5" />
33+ </svg >
34+ </div >
35+ <div class =" ad-content" >
36+ <div class =" ad-title" >
37+ 速来拼好模,智谱 GLM Coding 超值订阅
38+ <span class =" ad-emphasis" >(本项目同样使用智谱 AI 开发)</span >
39+ </div >
40+ <div class =" ad-description" >
41+ { glmCoding .description } 立即开拼,享限时惊喜价!
42+ </div >
43+ </div >
44+ <a
45+ href ={ glmCoding .url }
46+ target =" _blank"
47+ rel =" noopener noreferrer"
48+ class =" ad-button"
49+ >
50+ { glmCoding .label }
51+ <svg xmlns =" http://www.w3.org/2000/svg" width =" 14" height =" 14" viewBox =" 0 0 24 24" fill =" none" stroke =" currentColor" stroke-width =" 2" stroke-linecap =" round" stroke-linejoin =" round" >
52+ <path d =" M5 12h14" />
53+ <path d =" m12 5 7 7-7 7" />
54+ </svg >
55+ </a >
3156 </div >
32- <div class =" ad-content" >
33- <div class =" ad-title" >
34- 速来拼好模,智谱 GLM Coding 超值订阅
35- <span class =" ad-emphasis" >(本项目同样使用智谱 AI 开发)</span >
57+
58+ <!-- 阿里云推广卡片 -->
59+ <div class =" blog-header-ad ali-cloud-ad" >
60+ <div class =" ad-icon ali-cloud-icon" >
61+ <svg xmlns =" http://www.w3.org/2000/svg" width =" 20" height =" 20" viewBox =" 0 0 24 24" fill =" none" stroke =" currentColor" stroke-width =" 2" stroke-linecap =" round" stroke-linejoin =" round" >
62+ <path d =" M12 2v20" />
63+ <path d =" M2 12h20" />
64+ <path d =" m8 8 8 8" />
65+ <path d =" m16 8-8 8" />
66+ </svg >
3667 </div >
37- <div class =" ad-description" >
38- { glmCoding .description } 立即开拼,享限时惊喜价!
68+ <div class =" ad-content" >
69+ <div class =" ad-title" >
70+ 🚀 阿里云千问 Coding Plan 上线
71+ <span class =" ad-emphasis" >推荐 + Hagicode,完美实现开发过程中的各项需求</span >
72+ </div >
73+ <div class =" ad-description" >
74+ { aistar .description }
75+ </div >
3976 </div >
77+ <a
78+ href ={ aistar .url }
79+ target =" _blank"
80+ rel =" noopener noreferrer"
81+ class =" ad-button ali-cloud-button"
82+ >
83+ { aistar .label }
84+ <svg xmlns =" http://www.w3.org/2000/svg" width =" 14" height =" 14" viewBox =" 0 0 24 24" fill =" none" stroke =" currentColor" stroke-width =" 2" stroke-linecap =" round" stroke-linejoin =" round" >
85+ <path d =" M5 12h14" />
86+ <path d =" m12 5 7 7-7 7" />
87+ </svg >
88+ </a >
4089 </div >
41- <a
42- href ={ glmCoding .url }
43- target =" _blank"
44- rel =" noopener noreferrer"
45- class =" ad-button"
46- >
47- { glmCoding .label }
48- <svg xmlns =" http://www.w3.org/2000/svg" width =" 14" height =" 14" viewBox =" 0 0 24 24" fill =" none" stroke =" currentColor" stroke-width =" 2" stroke-linecap =" round" stroke-linejoin =" round" >
49- <path d =" M5 12h14" />
50- <path d =" m12 5 7 7-7 7" />
51- </svg >
52- </a >
5390</div >
5491
5592<style >
93+ .blog-header-ad-container {
94+ display: flex;
95+ flex-direction: column;
96+ gap: 1rem;
97+ margin-block-end: 1.5rem;
98+ }
99+
56100 .blog-header-ad {
57101 display: flex;
58102 align-items: flex-start;
59103 gap: 1rem;
60104 padding: 1rem;
61- margin-block-end: 1.5rem;
62105 border-radius: var(--sl-radius-md);
63106 background: linear-gradient(135deg,
64107 color-mix(in srgb, var(--color-primary) 8%, transparent),
@@ -67,6 +110,14 @@ const { glmCoding } = GLM_PROMO_LINKS;
67110 border: 1px solid color-mix(in srgb, var(--color-primary) 20%, var(--sl-color-gray-5));
68111 }
69112
113+ .ali-cloud-ad {
114+ background: linear-gradient(135deg,
115+ color-mix(in srgb, #FF6B00 8%, transparent),
116+ color-mix(in srgb, #FF8C42 5%, transparent)
117+ );
118+ border: 1px solid color-mix(in srgb, #FF6B00 20%, var(--sl-color-gray-5));
119+ }
120+
70121 .ad-icon {
71122 flex-shrink: 0;
72123 display: flex;
@@ -79,6 +130,10 @@ const { glmCoding } = GLM_PROMO_LINKS;
79130 color: white;
80131 }
81132
133+ .ali-cloud-icon {
134+ background: linear-gradient(135deg, #FF6B00, #FF8C42);
135+ }
136+
82137 .ad-content {
83138 flex: 1;
84139 min-width: 0;
@@ -101,6 +156,10 @@ const { glmCoding } = GLM_PROMO_LINKS;
101156 font-weight: 500;
102157 }
103158
159+ .ali-cloud-ad .ad-emphasis {
160+ color: #FF6B00;
161+ }
162+
104163 .ad-button {
105164 flex-shrink: 0;
106165 display: inline-flex;
@@ -116,11 +175,19 @@ const { glmCoding } = GLM_PROMO_LINKS;
116175 transition: transform 0.2s ease, box-shadow 0.2s ease;
117176 }
118177
178+ .ali-cloud-button {
179+ background: linear-gradient(135deg, #FF6B00, #FF8C42);
180+ }
181+
119182 .ad-button:hover {
120183 transform: translateY(-1px);
121184 box-shadow: 0 4px 12px rgba(0, 128, 255, 0.25);
122185 }
123186
187+ .ali-cloud-button:hover {
188+ box-shadow: 0 4px 12px rgba(255, 107, 0, 0.25);
189+ }
190+
124191 .ad-button svg {
125192 transition: transform 0.2s ease;
126193 }
@@ -131,6 +198,10 @@ const { glmCoding } = GLM_PROMO_LINKS;
131198
132199 /* 响应式优化 */
133200 @media (max-width: 640px) {
201+ .blog-header-ad-container {
202+ flex-direction: column;
203+ }
204+
134205 .blog-header-ad {
135206 flex-direction: column;
136207 }
0 commit comments