diff --git a/docs.json b/docs.json index 500bb1a8d..5c92ad2cc 100644 --- a/docs.json +++ b/docs.json @@ -25,31 +25,32 @@ }, "navbar": { "links": [ - { - "label": "Home", - "href": "https://langbot.app/en" - }, { "label": "Cloud", - "href": "https://space.langbot.app/cloud?language=en" + "href": "https://space.langbot.app/cloud?language=en", + "icon": "cloud" }, { "label": "Extensions", - "href": "https://space.langbot.app/market?language=en" + "href": "https://space.langbot.app/market?language=en", + "icon": "blocks" }, { "label": "Blog", - "href": "https://langbot.app/en/blog" + "href": "https://langbot.app/en/blog", + "icon": "newspaper" }, { "label": "Roadmap", - "href": "https://langbot.app/en/roadmap" + "href": "https://langbot.app/en/roadmap", + "icon": "map" } ], "primary": { "type": "button", "label": "GitHub", - "href": "https://github.com/langbot-app/LangBot" + "href": "https://github.com/langbot-app/LangBot", + "icon": "github" } }, "footer": { @@ -780,31 +781,32 @@ ], "navbar": { "links": [ - { - "label": "Home", - "href": "https://langbot.app/en" - }, { "label": "Cloud", - "href": "https://space.langbot.app/cloud?language=en" + "href": "https://space.langbot.app/cloud?language=en", + "icon": "cloud" }, { "label": "Extensions", - "href": "https://space.langbot.app/market?language=en" + "href": "https://space.langbot.app/market?language=en", + "icon": "blocks" }, { "label": "Blog", - "href": "https://langbot.app/en/blog" + "href": "https://langbot.app/en/blog", + "icon": "newspaper" }, { "label": "Roadmap", - "href": "https://langbot.app/en/roadmap" + "href": "https://langbot.app/en/roadmap", + "icon": "map" } ], "primary": { "type": "button", "label": "GitHub", - "href": "https://github.com/langbot-app/LangBot" + "href": "https://github.com/langbot-app/LangBot", + "icon": "github" } } }, @@ -1091,31 +1093,32 @@ ], "navbar": { "links": [ - { - "label": "首页", - "href": "https://langbot.app/zh" - }, { "label": "云服务", - "href": "https://space.langbot.app/cloud?language=zh" + "href": "https://space.langbot.app/cloud?language=zh", + "icon": "cloud" }, { "label": "扩展", - "href": "https://space.langbot.app/market?language=zh" + "href": "https://space.langbot.app/market?language=zh", + "icon": "blocks" }, { "label": "博客", - "href": "https://langbot.app/zh/blog" + "href": "https://langbot.app/zh/blog", + "icon": "newspaper" }, { "label": "路线图", - "href": "https://langbot.app/zh/roadmap" + "href": "https://langbot.app/zh/roadmap", + "icon": "map" } ], "primary": { "type": "button", "label": "GitHub", - "href": "https://github.com/langbot-app/LangBot" + "href": "https://github.com/langbot-app/LangBot", + "icon": "github" } } }, @@ -1377,31 +1380,32 @@ ], "navbar": { "links": [ - { - "label": "ホーム", - "href": "https://langbot.app/ja" - }, { "label": "クラウド", - "href": "https://space.langbot.app/cloud?language=ja" + "href": "https://space.langbot.app/cloud?language=ja", + "icon": "cloud" }, { "label": "拡張機能", - "href": "https://space.langbot.app/market?language=ja" + "href": "https://space.langbot.app/market?language=ja", + "icon": "blocks" }, { "label": "ブログ", - "href": "https://langbot.app/ja/blog" + "href": "https://langbot.app/ja/blog", + "icon": "newspaper" }, { "label": "ロードマップ", - "href": "https://langbot.app/ja/roadmap" + "href": "https://langbot.app/ja/roadmap", + "icon": "map" } ], "primary": { "type": "button", "label": "GitHub", - "href": "https://github.com/langbot-app/LangBot" + "href": "https://github.com/langbot-app/LangBot", + "icon": "github" } } } diff --git a/press.config.tsx b/press.config.tsx index 31787944b..962cad66a 100644 --- a/press.config.tsx +++ b/press.config.tsx @@ -9,7 +9,7 @@ import { update } from "fumadocs-core/source"; import { uiTranslations } from "fumadocs-ui/i18n"; import { defineDocs } from "fumadocs-mdx/macro"; import { createOpenAPI, type OpenAPIServer } from "fumadocs-openapi/server"; -import { Bot } from "lucide-react"; +import { Blocks, Bot, Cloud, ExternalLink, Map as MapIcon, Newspaper } from "lucide-react"; import { readFileSync, readdirSync } from "node:fs"; import path from "node:path"; @@ -204,21 +204,73 @@ function collectRouteLocales() { const routeLocales = collectRouteLocales(); +function GithubMark(props: import("react").ComponentProps<"svg">) { + return + + ; +} + +const QUICK_LINK_ICONS = { + blocks: Blocks, + cloud: Cloud, + github: GithubMark, + map: MapIcon, + newspaper: Newspaper, +} as const; + +type QuickLinkIcon = keyof typeof QUICK_LINK_ICONS; +type ConfiguredNavbarLink = { + href: string; + icon?: QuickLinkIcon; + label?: string; +}; +type ConfiguredNavbar = { + links?: ConfiguredNavbarLink[]; + primary?: ConfiguredNavbarLink & { type?: string }; +}; + +function quickLinkIcon(name: QuickLinkIcon | undefined) { + if (!name) return undefined; + const Icon = QUICK_LINK_ICONS[name]; + return