Skip to content

Commit

Permalink
chore: adopt suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
SoonIter committed Sep 3, 2024
1 parent 172b51b commit 23ee543
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 127 deletions.
28 changes: 14 additions & 14 deletions website/i18n.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"Introduction": {
"introduction": {
"en": "Introduction",
"zh": "介绍"
},
"QuickStart": {
"quickStart": {
"en": "Quick Start",
"zh": "快速上手"
},
Expand All @@ -15,51 +15,51 @@
"en": "Build your web application instantly",
"zh": "在瞬息之间构建你的 web 应用"
},
"RspackBased": {
"rspackBased": {
"en": "Rspack-based",
"zh": "基于 Rspack"
},
"RspackBasedDesc": {
"rspackBasedDesc": {
"en": "Using Rspack to bring you the ultimate development experience.",
"zh": "享受 Rspack 带来的极致开发体验。"
},
"BatteriesIncluded": {
"batteriesIncluded": {
"en": "Batteries Included",
"zh": "开箱即用"
},
"BatteriesIncludedDesc": {
"batteriesIncludedDesc": {
"en": "Out-of-the-box integration with the most practical building features in the ecosystem.",
"zh": "集成生态中最实用的构建功能。"
},
"FrameworkAgnostic": {
"frameworkAgnostic": {
"en": "Framework Agnostic",
"zh": "框架无关"
},
"FrameworkAgnosticDesc": {
"frameworkAgnosticDesc": {
"en": "Supports React, Vue, Svelte, and more frameworks.",
"zh": "支持 React、Vue、Solid、Svelte 等。"
},
"DeepOptimization": {
"deepOptimization": {
"en": "Deep Optimization",
"zh": "深度优化"
},
"DeepOptimizationDesc": {
"deepOptimizationDesc": {
"en": "Automatically optimize static assets to maximizing production performance.",
"zh": "自动优化静态资源,最大化生产性能。"
},
"HighlyPluggable": {
"highlyPluggable": {
"en": "Highly Pluggable",
"zh": "灵活插拔"
},
"HighlyPluggableDesc": {
"highlyPluggableDesc": {
"en": "Comes with a lightweight plugin system and a set of high quality plugins.",
"zh": "提供轻量级插件系统和一系列高质量插件。"
},
"EasyToConfigure": {
"easyToConfigure": {
"en": "EasyToConfigure",
"zh": "易于配置"
},
"EasyToConfigureDesc": {
"easyToConfigureDesc": {
"en": "Start with zero configuration and everything is configurable.",
"zh": "以零配置启动,然后一切皆可配置。"
},
Expand Down
8 changes: 8 additions & 0 deletions website/theme/components/Hero.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
:global {
.rs-oval {
width: 70% !important;
height: 70% !important;
top: calc(50% + 20px) !important;
left: calc(50% + 5px) !important;
}
}
34 changes: 12 additions & 22 deletions website/theme/components/Hero.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Hero as BaseHero } from '@rstack-dev/doc-ui/hero';
import { useI18n, useNavigate } from 'rspress/runtime';
import { useI18nUrl } from './utils';
import './Hero.module.scss';

export function Hero() {
const navigate = useNavigate();
Expand All @@ -13,27 +14,16 @@ export function Hero() {
navigate(tUrl('/guide/start/quick-start'));
};
return (
<>
<style>
{`.rs-oval {
width: 70% !important;
height: 70% !important;
top: calc(50% + 20px) !important;
left: calc(50% + 5px) !important;
}
`}
</style>
<BaseHero
showStars
onClickGetStarted={handleClickGetStarted}
onClickLearnMore={handleClickLearnMore}
title="Rsbuild"
subTitle={t('subtitle')}
description={t('slogan')}
logoUrl="https://assets.rspack.dev/rsbuild/rsbuild-logo.svg"
getStartedButtonText={t('Introduction')}
learnMoreButtonText={t('QuickStart')}
/>
</>
<BaseHero
showStars
onClickGetStarted={handleClickGetStarted}
onClickLearnMore={handleClickLearnMore}
title="Rsbuild"
subTitle={t('subtitle')}
description={t('slogan')}
logoUrl="https://assets.rspack.dev/rsbuild/rsbuild-logo.svg"
getStartedButtonText={t('introduction')}
learnMoreButtonText={t('quickStart')}
/>
);
}
51 changes: 0 additions & 51 deletions website/theme/components/ToolStack.module.scss

This file was deleted.

12 changes: 12 additions & 0 deletions website/theme/components/WhyRsbuild.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
:global {
.max-w-6xl.flex.m-auto {
max-width: 1440px;
}
html.dark {
--rp-home-feature-bg: linear-gradient(
135deg,
rgba(255, 255, 255, 0),
rgba(255, 255, 255, 0.03)
);
}
}
50 changes: 18 additions & 32 deletions website/theme/components/WhyRsbuild.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,63 +4,49 @@ import {
} from '@rstack-dev/doc-ui/section-style';
import { useI18n } from 'rspress/runtime';
import { HomeFeature } from 'rspress/theme';
import './WhyRsbuild.module.scss';

export function WhyRsbuild() {
const t = useI18n<typeof import('i18n')>();
const features = {
features: [
{
title: 'Rspack-based',
details: t('RspackBasedDesc'),
title: t('rspackBased'),
details: t('rspackBasedDesc'),
icon: '🚀',
},
{
title: 'Batteries Included',
details: t('BatteriesIncludedDesc'),
title: t('batteriesIncluded'),
details: t('batteriesIncludedDesc'),
icon: '🦄',
},
{
title: 'Framework Agnostic',
details: t('FrameworkAgnosticDesc'),
title: t('frameworkAgnostic'),
details: t('frameworkAgnosticDesc'),
icon: '🎯',
},
{
title: 'Deep Optimization',
details: t('DeepOptimizationDesc'),
title: t('deepOptimization'),
details: t('deepOptimizationDesc'),
icon: '🛠️',
},
{
title: 'Highly Pluggable',
details: t('HighlyPluggableDesc'),
title: t('highlyPluggable'),
details: t('highlyPluggableDesc'),
icon: '🎨',
},
{
title: 'Easy to Configure',
details: t('EasyToConfigureDesc'),
title: t('easyToConfigure'),
details: t('easyToConfigureDesc'),
icon: '🍭',
},
],
};
return (
<>
<style>
{`.max-w-6xl.flex.m-auto {
max-width: 1440px;
}
html.dark {
--rp-home-feature-bg: linear-gradient(
135deg,
rgba(255, 255, 255, 0),
rgba(255, 255, 255, 0.03)
);
}
`}
</style>
<section className={containerStyle}>
<div className={innerContainerStyle}>
<HomeFeature frontmatter={features} routePath="/" />
</div>
</section>
</>
<section className={containerStyle}>
<div className={innerContainerStyle}>
<HomeFeature frontmatter={features} routePath="/" />
</div>
</section>
);
}
8 changes: 0 additions & 8 deletions website/theme/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,5 @@ export function HomeLayout() {
<ToolStack />
<CopyRight />
</div>
// <BasicHomeLayout
// afterFeatures={
// <>
// <Benchmark />
// <ToolStack />
// </>
// }
// />
);
}

0 comments on commit 23ee543

Please sign in to comment.