Skip to content

Commit f31741e

Browse files
author
福晋
committed
feat: update theme & remove stats
1 parent 2e0aaa9 commit f31741e

3 files changed

Lines changed: 6 additions & 104 deletions

File tree

‎src/compiler/config.ts‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ export interface AntVSiteConfig {
8282
description: LocalizedText;
8383
image?: string;
8484
imageAlt?: LocalizedText;
85-
showStats?: boolean;
8685
featuresTitle?: LocalizedText;
8786
featuresDescription?: LocalizedText;
8887
actions?: LocalizedLink[];
@@ -166,7 +165,6 @@ export interface ResolvedSiteConfig {
166165
description: LocalizedText;
167166
image?: string;
168167
imageAlt?: LocalizedText;
169-
showStats: boolean;
170168
featuresTitle?: LocalizedText;
171169
featuresDescription?: LocalizedText;
172170
actions: LocalizedLink[];
@@ -365,7 +363,6 @@ const configSchema = z
365363
description: localizedTextSchema,
366364
image: z.string().optional(),
367365
imageAlt: localizedTextSchema.optional(),
368-
showStats: z.boolean().default(true),
369366
featuresTitle: localizedTextSchema.optional(),
370367
featuresDescription: localizedTextSchema.optional(),
371368
actions: z.array(linkSchema).default([]),

‎src/theme/pages/[locale]/index.astro‎

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
2-
import { getAntvDocIdentity, localize } from '../../lib/compiler';
3-
import { getDocsCollection } from '../../lib/docs';
2+
import { localize } from '../../lib/compiler';
43
import arrowRightIcon from '@tabler/icons/outline/arrow-right.svg?raw';
54
import bracesIcon from '@tabler/icons/outline/braces.svg?raw';
65
import codeIcon from '@tabler/icons/outline/code.svg?raw';
@@ -17,8 +16,6 @@ export function getStaticPaths() {
1716
}
1817
1918
const locale = String(Astro.params['locale']) as 'zh' | 'en';
20-
const documents = (await getDocsCollection())
21-
.filter((entry) => config.site.locales.includes(getAntvDocIdentity(entry.id).locale));
2219
const home = config.home;
2320
const route = `/${locale}/`;
2421
const localHref = (href: string) => {
@@ -32,20 +29,6 @@ const localHref = (href: string) => {
3229
`/${locale}${href.startsWith('/') ? href : `/${href}`}`.replace(/\/$/, '') + '/',
3330
);
3431
};
35-
const homeStats = [
36-
{
37-
value: documents.length,
38-
label: locale === 'zh' ? '篇本地化文档' : 'localized documents',
39-
},
40-
{
41-
value: registry.counts.demos,
42-
label: locale === 'zh' ? '个静态示例' : 'static examples',
43-
},
44-
{
45-
value: registry.groups.length,
46-
label: locale === 'zh' ? '个内容分组' : 'content groups',
47-
},
48-
].filter((item) => item.value > 0);
4932
const featureIcons = [bracesIcon, componentsIcon, codeIcon];
5033
const imageAlt = localize(
5134
home.imageAlt,
@@ -118,18 +101,6 @@ const imageAlt = localize(
118101
<SlotComponent locale={locale} config={config} registry={registry} slotName="afterHero" />
119102
))}
120103

121-
{home.showStats && homeStats.length > 0 && (
122-
<section
123-
class="home-proof"
124-
aria-label={locale === 'zh' ? '站点内容统计' : 'Site content summary'}
125-
style={`--home-stat-count: ${homeStats.length}`}
126-
>
127-
{homeStats.map((stat) => (
128-
<div><strong>{stat.value}</strong><span>{stat.label}</span></div>
129-
))}
130-
</section>
131-
)}
132-
133104
{homeSlots.beforeFeatures.map((SlotComponent) => (
134105
<SlotComponent locale={locale} config={config} registry={registry} slotName="beforeFeatures" />
135106
))}

‎src/theme/styles/global.css‎

Lines changed: 5 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
"Apple Color Emoji",
1717
"Segoe UI Emoji";
1818
--font-heading-weight: 900;
19-
--brand: #873bf4;
20-
--brand-strong: #722ed1;
21-
--brand-soft: #f9f0ff;
22-
--brand-faint: #fcf8ff;
23-
--brand-button: #722ed1;
19+
--brand: #691eff;
20+
--brand-strong: #5312d6;
21+
--brand-soft: #f0e8ff;
22+
--brand-faint: #faf7ff;
23+
--brand-button: #5a16c9;
2424
--text: #383a42;
2525
--text-strong: #1d2129;
2626
--muted: #697b8c;
@@ -865,53 +865,6 @@ kbd {
865865
backdrop-filter: blur(16px);
866866
}
867867

868-
.home-proof {
869-
position: relative;
870-
z-index: 3;
871-
display: grid;
872-
grid-template-columns: repeat(var(--home-stat-count, 3), minmax(0, 1fr));
873-
width: min(calc(100% - 56px), 980px);
874-
margin: -42px auto 0;
875-
padding: 18px;
876-
border: 1px solid var(--home-border);
877-
border-radius: 22px;
878-
background: var(--home-surface);
879-
box-shadow:
880-
inset 0 1px 0 rgb(255 255 255 / 72%),
881-
0 22px 54px rgb(69 49 126 / 10%);
882-
backdrop-filter: blur(20px) saturate(116%);
883-
}
884-
885-
.home-proof div {
886-
display: flex;
887-
min-height: 82px;
888-
flex-direction: column;
889-
justify-content: center;
890-
padding: 8px 28px;
891-
border-right: 1px solid
892-
color-mix(in srgb, var(--brand) 11%, var(--border-soft));
893-
text-align: center;
894-
}
895-
896-
.home-proof div:last-child {
897-
border-right: 0;
898-
}
899-
900-
.home-proof strong {
901-
color: var(--brand-strong);
902-
font-size: clamp(32px, 3vw, 42px);
903-
font-weight: 700;
904-
line-height: 1;
905-
letter-spacing: -0.05em;
906-
}
907-
908-
.home-proof span {
909-
margin-top: 10px;
910-
color: var(--muted);
911-
font-size: 12px;
912-
letter-spacing: 0.02em;
913-
}
914-
915868
.feature-section {
916869
position: relative;
917870
width: 100%;
@@ -1118,7 +1071,6 @@ kbd {
11181071

11191072
@media (prefers-reduced-transparency: reduce) {
11201073
.hero-showcase-frame,
1121-
.home-proof,
11221074
.feature-list article {
11231075
background: var(--surface-raised);
11241076
backdrop-filter: none;
@@ -2400,24 +2352,6 @@ kbd {
24002352
border-radius: 24px;
24012353
}
24022354

2403-
.home-proof {
2404-
grid-template-columns: 1fr;
2405-
width: calc(100% - 24px);
2406-
margin-top: -22px;
2407-
padding: 12px;
2408-
border-radius: 18px;
2409-
}
2410-
2411-
.home-proof div {
2412-
padding: 20px 12px;
2413-
border-right: 0;
2414-
border-bottom: 1px solid var(--border-soft);
2415-
}
2416-
2417-
.home-proof div:last-child {
2418-
border-bottom: 0;
2419-
}
2420-
24212355
.feature-section {
24222356
width: calc(100% - 24px);
24232357
}

0 commit comments

Comments
 (0)