{t.title}
-{t.description}
-From 39f610c5f2a966a137e737d30f19c89ae146745d Mon Sep 17 00:00:00 2001 From: Nexmoe <16796652+nexmoe@users.noreply.github.com> Date: Sat, 5 Dec 2026 16:47:37 +0800 Subject: [PATCH 1/2] Redesign the LMSpeed Models catalog directories --- apps/site/src/components/Catalogue.astro | 197 +- .../src/components/DevelopersDirectory.astro | 39 + apps/site/src/components/Directory.astro | 48 + apps/site/src/components/DirectoryLinks.astro | 11 + apps/site/src/components/HelpDialog.astro | 85 + apps/site/src/components/Icon.astro | 10 + apps/site/src/components/LocaleLinks.astro | 11 + apps/site/src/components/Logo.astro | 10 + .../site/src/components/ModelsDirectory.astro | 255 +-- .../src/components/ProvidersDirectory.astro | 123 +- apps/site/src/components/TableHead.astro | 19 + apps/site/src/lib/catalogue-controls.ts | 517 ++++-- apps/site/src/lib/catalogue.ts | 117 +- apps/site/src/lib/details.ts | 479 +++++ apps/site/src/lib/directory-data.ts | 69 + apps/site/src/lib/element.ts | 8 + apps/site/src/lib/glyphs.ts | 16 + apps/site/src/lib/markdown.ts | 2 +- apps/site/src/lib/search-controls.ts | 200 ++ apps/site/src/lib/table-controls.ts | 86 + apps/site/src/messages/en.json | 83 +- apps/site/src/messages/ru.json | 83 +- apps/site/src/messages/zh.json | 83 +- apps/site/src/pages/404.astro | 17 +- apps/site/src/pages/[...directory].astro | 14 + apps/site/src/pages/index.astro | 4 - apps/site/src/pages/llms-full.txt.ts | 4 +- apps/site/src/pages/ru/index.astro | 4 - apps/site/src/pages/search.json.ts | 3 + apps/site/src/pages/sitemap.xml.ts | 27 +- apps/site/src/pages/zh/index.astro | 4 - apps/site/src/styles/catalogue.css | 1613 ++++++++++++----- apps/site/wrangler.jsonc | 2 +- scripts/validate-artifacts.ts | 96 +- tests/site.spec.ts | 313 +++- 35 files changed, 3505 insertions(+), 1147 deletions(-) create mode 100644 apps/site/src/components/DevelopersDirectory.astro create mode 100644 apps/site/src/components/Directory.astro create mode 100644 apps/site/src/components/DirectoryLinks.astro create mode 100644 apps/site/src/components/HelpDialog.astro create mode 100644 apps/site/src/components/Icon.astro create mode 100644 apps/site/src/components/LocaleLinks.astro create mode 100644 apps/site/src/components/Logo.astro create mode 100644 apps/site/src/components/TableHead.astro create mode 100644 apps/site/src/lib/details.ts create mode 100644 apps/site/src/lib/directory-data.ts create mode 100644 apps/site/src/lib/element.ts create mode 100644 apps/site/src/lib/glyphs.ts create mode 100644 apps/site/src/lib/search-controls.ts create mode 100644 apps/site/src/lib/table-controls.ts create mode 100644 apps/site/src/pages/[...directory].astro delete mode 100644 apps/site/src/pages/index.astro delete mode 100644 apps/site/src/pages/ru/index.astro create mode 100644 apps/site/src/pages/search.json.ts delete mode 100644 apps/site/src/pages/zh/index.astro diff --git a/apps/site/src/components/Catalogue.astro b/apps/site/src/components/Catalogue.astro index d459bb30..f6306e54 100644 --- a/apps/site/src/components/Catalogue.astro +++ b/apps/site/src/components/Catalogue.astro @@ -1,131 +1,130 @@ --- import '@fontsource-variable/noto-sans'; -import { catalog } from '@lmspeed/models-publish'; -import { - type Locale, - localePath, - locales, - messages, - siteUrl, -} from '../lib/catalogue'; +import { type Locale, localePath, locales, markdownPath, messages, type Section, siteUrl } from '../lib/catalogue'; +import { glyphs } from '../lib/glyphs'; import '../styles/catalogue.css'; +import DevelopersDirectory from './DevelopersDirectory.astro'; +import DirectoryLinks from './DirectoryLinks.astro'; +import HelpDialog from './HelpDialog.astro'; +import Icon from './Icon.astro'; +import LocaleLinks from './LocaleLinks.astro'; import ModelsDirectory from './ModelsDirectory.astro'; import ProvidersDirectory from './ProvidersDirectory.astro'; interface Props { - locale?: Locale; + locale: Locale; + section: Section; } -const { locale = 'en' } = Astro.props; +const { locale, section } = Astro.props; const t = messages[locale]; -const canonical = `${siteUrl}${localePath(locale)}`; -const counts = catalog.api.counts; -const snippets = { - HTTP: `curl ${siteUrl}/v2/models/openai/gpt-5.json -curl ${siteUrl}/v2/providers/openai.json -curl ${siteUrl}/v2/api.json`, - 'JavaScript / TypeScript': `import { Client } from '@lmspeed/models'; - -const client = new Client(); -const model = await client.fetchModel('openai/gpt-5'); -const provider = await client.fetchProvider('openai'); -const catalog = await client.refresh();`, -}; +const canonical = `${siteUrl}${localePath(locale, section)}`; +const title = `${section === 'models' ? t.title : t[section]} · LMSpeed Models`; +const description = section === 'models' ? t.description : `${t[section]} · ${t.description}`; +const ogLocales = { en: 'en_US', zh: 'zh_CN', ru: 'ru_RU' }; +const github = 'https://github.com/LMSpeed/models'; ---
- -{t.description}
-