diff --git a/website/src/components/GetStarted.astro b/website/src/components/GetStarted.astro new file mode 100644 index 00000000..f08c36a1 --- /dev/null +++ b/website/src/components/GetStarted.astro @@ -0,0 +1,18 @@ +--- +import InstallCommand from '@/components/ui/InstallCommand.astro'; +import SectionHeading from '@/components/ui/SectionHeading.astro'; +import type { GetStartedData } from '@/data/landing-page'; + +type Props = GetStartedData; + +const { eyebrow, heading, description, install } = Astro.props; +--- + +
+
+ +
+ +
+
+
diff --git a/website/src/components/Hero.astro b/website/src/components/Hero.astro index 475cba07..7b3548c4 100644 --- a/website/src/components/Hero.astro +++ b/website/src/components/Hero.astro @@ -1,7 +1,6 @@ --- import Contributors from '@/components/Contributors.astro'; import Icon from '@/components/ui/Icon.astro'; -import InstallCommand from '@/components/ui/InstallCommand.astro'; import LinkButton from '@/components/ui/LinkButton.astro'; import type { GitHubContributor } from '@/lib/github'; import { Code } from 'astro:components'; @@ -10,17 +9,10 @@ interface Props { badge?: string; title?: string; description?: string; - installCommands: { - posix: string; - windows: string; - }; - installPlatformLabel: string; - posixInstallLabel: string; - windowsInstallLabel: string; - copyInstallCommandLabel: string; - copiedInstallCommandLabel: string; primaryHref: string; primaryLabel?: string; + secondaryHref?: string; + secondaryLabel?: string; contributorsLabel?: string; contributors?: GitHubContributor[]; } @@ -29,14 +21,10 @@ const { badge, title, description, - installCommands, - installPlatformLabel, - posixInstallLabel, - windowsInstallLabel, - copyInstallCommandLabel, - copiedInstallCommandLabel, primaryHref, primaryLabel, + secondaryHref, + secondaryLabel, contributorsLabel, contributors = [], }: Props = Astro.props; @@ -61,136 +49,6 @@ class MyPlugin: prompt, model=state.get("model") ) return reply.text`; - -const heroCodeScopes = { - keyword: [ - 'keyword.control', - 'keyword.operator', - 'storage.type', - 'storage.modifier', - 'keyword.other.unit.python', - ], - decorator: [ - 'entity.name.function.decorator', - 'entity.name.function.decorator.python', - 'meta.annotation', - 'meta.annotation punctuation', - ], - functionName: [ - 'entity.name.function', - 'meta.function.python entity.name.function.python', - 'meta.function-call.generic.python', - ], - callable: [ - 'support.function', - 'support.function.builtin', - 'support.type.property-name', - 'meta.function-call.python', - ], - parameter: [ - 'variable.parameter', - 'variable.parameter.function.python', - 'meta.function-call.arguments.python', - ], - string: [ - 'string', - 'string.quoted', - 'comment.block.documentation', - 'punctuation.definition.string', - ], - punctuation: [ - 'punctuation', - 'meta.brace', - 'meta.delimiter', - 'entity.name.type', - ], -}; - -function createHeroCodeTheme(name, type, palette) { - return { - name, - type, - colors: { - 'editor.background': palette.background, - 'editor.foreground': palette.foreground, - }, - tokenColors: [ - { - settings: { - foreground: palette.foreground, - }, - }, - { - scope: heroCodeScopes.keyword, - settings: { - foreground: palette.keyword, - fontStyle: 'italic', - }, - }, - { - scope: heroCodeScopes.decorator, - settings: { - foreground: palette.decorator, - }, - }, - { - scope: heroCodeScopes.functionName, - settings: { - foreground: palette.functionName, - }, - }, - { - scope: heroCodeScopes.callable, - settings: { - foreground: palette.callable, - }, - }, - { - scope: heroCodeScopes.parameter, - settings: { - foreground: palette.parameter, - }, - }, - { - scope: heroCodeScopes.string, - settings: { - foreground: palette.string, - }, - }, - { - scope: heroCodeScopes.punctuation, - settings: { - foreground: palette.punctuation, - }, - }, - ], - }; -} - -const heroCodeThemes = { - light: createHeroCodeTheme('bub-hero-light', 'light', { - background: '#F6F7F9', - foreground: '#403F53', - keyword: '#8844AE', - decorator: '#3B61B0', - functionName: '#3B61B0', - callable: '#096E72', - parameter: '#096E72', - string: '#984E4D', - punctuation: '#111111', - }), - dark: createHeroCodeTheme('bub-hero-dark', 'dark', { - background: '#252525', - foreground: '#D6DEEB', - keyword: '#C792EA', - decorator: '#C5E478', - functionName: '#82AAFF', - callable: '#B2CCD6', - parameter: '#7FDBCA', - string: '#ECC48D', - punctuation: '#D9F5DD', - }), -}; ---
@@ -222,23 +80,16 @@ const heroCodeThemes = { )} -
- -
- -
+
{primaryLabel} - + {secondaryHref && ( + + {secondaryLabel} + + )}
@@ -252,10 +103,7 @@ const heroCodeThemes = { diff --git a/website/src/components/ui/InstallCommand.astro b/website/src/components/ui/InstallCommand.astro index d37d546a..9d4fa5b7 100644 --- a/website/src/components/ui/InstallCommand.astro +++ b/website/src/components/ui/InstallCommand.astro @@ -1,66 +1,64 @@ --- import Icon from '@/components/ui/Icon.astro'; +import type { InstallCommandData } from '@/data/landing-page'; +import { Code } from 'astro:components'; interface Props { - commands: { - posix: string; - windows: string; - }; - platformLabel: string; - posixLabel: string; - windowsLabel: string; - copyLabel: string; - copiedLabel: string; + install: InstallCommandData; } -const { commands, platformLabel, posixLabel, windowsLabel, copyLabel, copiedLabel } = Astro.props; -const installOptions = [ - { id: 'posix', label: posixLabel, command: commands.posix }, - { id: 'windows', label: windowsLabel, command: commands.windows }, -]; +const { install } = Astro.props; +const { platforms, copyLabel, copiedLabel } = install; ---
-
- {installOptions.map((option, index) => ( +
+ {platforms.map((platform, index) => ( ))}
-
+
- - {commands.posix} - +
+ {platforms.map((platform, index) => ( + + ))} +
+ diff --git a/website/src/pages/[...locale]/index.astro b/website/src/pages/[...locale]/index.astro index 60131cf3..17248264 100644 --- a/website/src/pages/[...locale]/index.astro +++ b/website/src/pages/[...locale]/index.astro @@ -38,6 +38,7 @@ const testimonials = { description={t('site.description')} ogImage={ogImage} hero={pageData.hero} + getStarted={pageData.getStarted} features={pageData.features} hookIntro={pageData.hookIntro} tapeModel={pageData.tapeModel}