Skip to content

Commit b9ac216

Browse files
committed
update docs
1 parent 12b7584 commit b9ac216

4 files changed

Lines changed: 33 additions & 19 deletions

File tree

docs/.vuepress/components/SponsorPage.vue

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { computed, h, onBeforeUnmount, ref } from 'vue'
33
import { withBase } from 'vuepress/client'
44
import { useI18n } from '../composables/useI18n'
5+
import { getBoothAspectRatio, isBoothFull } from '../data/sponsors'
56
67
type SponsorTab = 'honor' | 'booth'
78
type SponsorIconName = 'alipay' | 'wechat' | 'arrow-right' | 'check' | 'copy' | 'sponsor'
@@ -10,11 +11,9 @@ type SnippetKey = 'promotion' | 'inquiry'
1011
interface BoothPlan {
1112
key: string
1213
name: string
13-
status: 'vacant' | 'full' | string
1414
price: string
1515
quota?: string
1616
placements: string[]
17-
material: string
1817
}
1918
2019
const { t, tm, withLocale } = useI18n()
@@ -57,12 +56,13 @@ const whyLink = computed(() =>
5756
)
5857
const groupLink = computed(() => withBase(withLocale('/group.html')))
5958
60-
function isBoothFull(plan: BoothPlan) {
61-
return plan.status === 'full'
59+
function statusLabel(plan: BoothPlan) {
60+
return isBoothFull(plan.key) ? t('sponsors.statusFull') : t('sponsors.statusVacant')
6261
}
6362
64-
function statusLabel(plan: BoothPlan) {
65-
return plan.status === 'full' ? t('sponsors.statusFull') : t('sponsors.statusVacant')
63+
function materialLabel(plan: BoothPlan) {
64+
const ratio = getBoothAspectRatio(plan.key)
65+
return ratio ? t('sponsors.materialText', { ratio }) : ''
6666
}
6767
6868
const sponsorEmail = 'jianhengwu0407@gmail.com'
@@ -188,7 +188,7 @@ onBeforeUnmount(() => {
188188

189189
<div class="booth-grid">
190190
<article v-for="plan in boothPlans" :key="plan.key || plan.name" class="booth-card"
191-
:class="{ 'is-full': isBoothFull(plan) }">
191+
:class="{ 'is-full': isBoothFull(plan.key) }">
192192
<div class="booth-head">
193193
<div>
194194
<div class="booth-badges">
@@ -197,15 +197,15 @@ onBeforeUnmount(() => {
197197
</div>
198198
<h3>{{ plan.name }}</h3>
199199
</div>
200-
<strong v-if="!isBoothFull(plan)">{{ plan.price }}</strong>
200+
<strong v-if="!isBoothFull(plan.key)">{{ plan.price }}</strong>
201201
</div>
202202
<ul class="check-list">
203203
<li v-for="placement in plan.placements" :key="placement">
204204
<SponsorIcon name="check" />
205205
<span>{{ placement }}</span>
206206
</li>
207207
</ul>
208-
<p class="material-line">{{ t('sponsors.materialPrefix') }}{{ plan.material }}</p>
208+
<p v-if="materialLabel(plan)" class="material-line">{{ t('sponsors.materialPrefix') }}{{ materialLabel(plan) }}</p>
209209
</article>
210210
</div>
211211

docs/.vuepress/data/sponsors.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,22 @@ export const boothCapacity = {
5858
gold: 3,
5959
} as const;
6060

61+
/**
62+
* 展位横版图比例
63+
* 素材对应 Sponsor 字段:link 横版图链接、alt 品牌名、href 跳转链接
64+
*/
65+
export const boothAspectRatio = {
66+
exclusive: '7:3',
67+
gold: '7:3',
68+
silver: '5:3',
69+
} as const;
70+
71+
export type BoothKey = keyof typeof boothAspectRatio;
72+
73+
export function getBoothAspectRatio(key: string): string | undefined {
74+
return boothAspectRatio[key as BoothKey];
75+
}
76+
6177
export function shouldShowSponsor(sponsor: Sponsor): boolean {
6278
if (!sponsor.alt || sponsor.alt.includes(PLACEHOLDER_ALT) || !sponsor.expiryTime) {
6379
return false;

docs/.vuepress/locales/en-US.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ export default {
246246
contactEmail: 'Email us',
247247
mailSubject: 'fba booth sponsorship inquiry',
248248
materialPrefix: 'Creative: ',
249+
materialText: '{ratio} landscape image URL, brand name, and destination URL',
249250
promotionLabel: 'Promotion:',
250251
promotionDesc:
251252
'Exclusive or Gold booth sponsorship includes one Discord community announcement for your product',
@@ -284,7 +285,6 @@ export default {
284285
'Exclusive right sidebar on blog',
285286
'Visible on mobile',
286287
],
287-
material: '7:3 landscape image, brand name, logo, and link',
288288
},
289289
{
290290
key: 'gold',
@@ -296,23 +296,22 @@ export default {
296296
'Visible on GitHub README',
297297
'Large right sidebar on docs',
298298
],
299-
material: 'Same as Exclusive',
300299
},
301300
{
302301
key: 'silver',
303302
name: 'Silver Booth',
304303
price: 'Contact / mo',
305304
placements: ['Scrolling homepage carousel slot', 'Small right sidebar on docs'],
306-
material: '5:3 landscape image, brand name, logo, and link',
307305
},
308306
],
309307
promotionRules: [
310308
'Prefer internet products related to developers, such as keyboards, monitors, headphones, low-code platforms, developer tools, cloud servers, personal blogs, etc. Non-developer products may be considered case by case',
311309
'No promotions that violate laws or involve gray-area products',
312310
],
313311
inquiryLines: [
314-
'Product name:',
315-
'Website / landing page:',
312+
'Brand name:',
313+
'Destination URL:',
314+
'Landscape image URL:',
316315
'Preferred tier: Exclusive / Gold / Silver',
317316
'Duration: 1 month / 3 months / 12 months',
318317
'Preferred go-live date:',

docs/.vuepress/locales/zh-CN.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ export default {
233233
contactEmail: '邮件联系',
234234
mailSubject: 'fba 展位赞助咨询',
235235
materialPrefix: '素材:',
236+
materialText: '{ratio} 横版图链接、品牌名、跳转链接',
236237
promotionLabel: '推广:',
237238
promotionDesc: '选择【独家展位、金牌展位】赞助,可帮助您的产品在 Discord 社区以公告的形式进行推广一次',
238239
announcementHint: '公告消息如下:(您也可以提供自定义非政治、非法律法规敏感的推广词/图片)',
@@ -266,7 +267,6 @@ export default {
266267
'博客右侧边栏独家展示位',
267268
'移动端可见',
268269
],
269-
material: '7:3 横版图,品牌名、Logo、链接',
270270
},
271271
{
272272
key: 'gold',
@@ -278,23 +278,22 @@ export default {
278278
'GitHub README 可见',
279279
'文档右侧边栏大号展示位',
280280
],
281-
material: '同独家',
282281
},
283282
{
284283
key: 'silver',
285284
name: '银牌展位',
286285
price: '沟通 / 月',
287286
placements: ['首页轮播滚动展示位', '文档右侧边栏小号展示位'],
288-
material: '5:3 横版图,品牌名、Logo、链接',
289287
},
290288
],
291289
promotionRules: [
292290
'优先推广和程序员相关的互联网产品,比如:键盘、显示器、耳机、低代码开发平台、开发软件、云服务器、个人博客等等;如果与程序员无关,可酌情考虑',
293291
'拒绝一切违反法律法规、灰产相关的产品推广',
294292
],
295293
inquiryLines: [
296-
'产品名称:',
297-
'官网 / 落地页:',
294+
'品牌名:',
295+
'跳转链接:',
296+
'横版图链接:',
298297
'意向档位:独家 / 金牌 / 银牌',
299298
'投放周期:1 个月 / 3 个月 / 12 个月',
300299
'希望上线时间:',

0 commit comments

Comments
 (0)