Merge branch 'docs-landing-hero-redesign'

This commit is contained in:
t8y2
2026-05-16 18:43:45 +08:00
22 changed files with 3712 additions and 1115 deletions
+39
View File
@@ -0,0 +1,39 @@
name: Sync Changelog to R2
on:
release:
types: [published]
workflow_dispatch:
jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Generate changelog JSON
run: node scripts/sync-changelog.mjs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}
- name: Upload to R2
run: |
pip install awscli --quiet
aws s3 cp releases-cn.json "s3://${R2_BUCKET_NAME}/changelog/releases-cn.json" \
--endpoint-url "https://${R2_ACCOUNT_ID}.r2.cloudflarestorage.com" \
--content-type application/json
if [ -f releases-en.json ]; then
aws s3 cp releases-en.json "s3://${R2_BUCKET_NAME}/changelog/releases-en.json" \
--endpoint-url "https://${R2_ACCOUNT_ID}.r2.cloudflarestorage.com" \
--content-type application/json
fi
env:
AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
R2_BUCKET_NAME: ${{ secrets.R2_BUCKET_NAME }}
+40
View File
@@ -0,0 +1,40 @@
import { fetchChangelog } from '@/lib/changelog';
import { LandingNav } from '@/components/landing/LandingNav';
import { ChangelogList } from '@/components/landing/ChangelogList';
const i18n = {
en: {
title: 'Changelog',
desc: 'Track every release — features, improvements, and fixes.',
},
cn: {
title: '更新日志',
desc: '追踪每次发布 — 新功能、改进和修复。',
},
};
export default async function ChangelogPage({ params }: { params: Promise<{ lang: string }> }) {
const { lang } = await params;
const l = lang === 'cn' ? 'cn' : 'en';
const t = i18n[l];
const data = await fetchChangelog(l);
return (
<div className="min-h-screen bg-[#0b1120] text-landing-ink">
<LandingNav lang={l} active="changelog" />
<div className="max-w-[860px] mx-auto px-6 pt-32 pb-4">
<h1 className="text-4xl font-[820] tracking-tight">{t.title}</h1>
<p className="mt-3 text-landing-muted text-lg">{t.desc}</p>
</div>
<div className="max-w-[860px] mx-auto px-6 pb-24">
{data.releases.length === 0 ? (
<p className="text-landing-muted py-12">No releases found.</p>
) : (
<ChangelogList releases={data.releases} lang={l} />
)}
</div>
</div>
);
}
+117
View File
@@ -0,0 +1,117 @@
import { LandingNav } from '@/components/landing/LandingNav';
const channels = [
{
id: 'qq',
color: '#EB1923',
href: 'https://qm.qq.com/cgi-bin/qm/qr?k=&group_code=1087880322',
icon: <img src="/icons/community/qq.png" alt="QQ" width={24} height={24} />,
},
{
id: 'wechat',
color: '#07C160',
href: 'https://docs.qq.com/doc/DVVhMY0h1ekJqc0tz',
icon: (
<svg width={24} height={24} viewBox="0 0 24 24" fill="currentColor">
<path d="M9.5 4C5.36 4 2 6.69 2 10c0 1.89 1.08 3.56 2.78 4.66l-.7 2.1 2.46-1.23c.87.27 1.8.42 2.78.42.24 0 .48-.01.71-.03A5.93 5.93 0 0110 14c0-3.31 3.13-6 7-6 .34 0 .67.03 1 .07C17.27 5.56 13.72 4 9.5 4zm-3 4.5a1 1 0 110-2 1 1 0 010 2zm5 0a1 1 0 110-2 1 1 0 010 2zM22 14c0-2.76-2.69-5-6-5s-6 2.24-6 5 2.69 5 6 5c.73 0 1.43-.11 2.09-.3l1.72.86-.49-1.46C20.94 17.07 22 15.64 22 14zm-7.5-.5a.75.75 0 110-1.5.75.75 0 010 1.5zm4 0a.75.75 0 110-1.5.75.75 0 010 1.5z" />
</svg>
),
},
{
id: 'discord',
color: '#5865F2',
href: 'https://discord.gg/W7NyVDRt6a',
icon: (
<svg width={24} height={24} viewBox="0 0 24 24" fill="currentColor">
<path d="M20.317 4.37a19.791 19.791 0 00-4.885-1.515.074.074 0 00-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 00-5.487 0 12.64 12.64 0 00-.617-1.25.077.077 0 00-.079-.037A19.736 19.736 0 003.677 4.37a.07.07 0 00-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 00.031.057 19.9 19.9 0 005.993 3.03.078.078 0 00.084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 00-.041-.106 13.107 13.107 0 01-1.872-.892.077.077 0 01-.008-.128 10.2 10.2 0 00.372-.292.074.074 0 01.077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 01.078.01c.12.098.246.198.373.292a.077.077 0 01-.006.127 12.299 12.299 0 01-1.873.892.077.077 0 00-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 00.084.028 19.839 19.839 0 006.002-3.03.077.077 0 00.032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 00-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.095 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.095 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z" />
</svg>
),
},
{
id: 'github',
color: '#f0f0f0',
href: 'https://github.com/t8y2/dbx/discussions',
icon: (
<svg width={24} height={24} viewBox="0 0 24 24" fill="currentColor">
<path d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z" />
</svg>
),
},
];
const i18n = {
en: {
title: 'Community',
desc: 'Join the DBX community — ask questions, share feedback, and connect with other users.',
discord: { name: 'Discord', desc: 'Real-time chat, Q&A, and feature discussions.' },
qq: { name: 'QQ Group', desc: 'Group number: 1087880322' },
wechat: { name: 'WeChat Group', desc: 'Join via Tencent Docs invite link.' },
github: { name: 'GitHub Discussions', desc: 'Bug reports, feature requests, and long-form discussions.' },
},
cn: {
title: '交流群',
desc: '加入 DBX 社区 — 提问、反馈、与其他用户交流。',
discord: { name: 'Discord', desc: '实时聊天、问答和功能讨论。' },
qq: { name: 'QQ 群', desc: '群号:1087880322' },
wechat: { name: '微信群', desc: '通过腾讯文档链接加入。' },
github: { name: 'GitHub Discussions', desc: 'Bug 反馈、功能建议和深度讨论。' },
},
};
export default async function CommunityPage({ params }: { params: Promise<{ lang: string }> }) {
const { lang } = await params;
const l = lang === 'cn' ? 'cn' : 'en';
const t = i18n[l];
return (
<div className="min-h-screen bg-[#0b1120] text-landing-ink">
<LandingNav lang={l} active="community" />
<div className="max-w-[860px] mx-auto px-6 pt-32 pb-4">
<h1 className="text-4xl font-[820] tracking-tight">{t.title}</h1>
<p className="mt-3 text-landing-muted text-lg">{t.desc}</p>
</div>
<div className="max-w-[860px] mx-auto px-6 pb-24">
<div className="grid gap-4 mt-8">
{channels.map((ch) => {
const meta = t[ch.id as keyof typeof t] as { name: string; desc: string };
return (
<a
key={ch.id}
href={ch.href}
target="_blank"
rel="noopener noreferrer"
className="group flex items-center gap-5 rounded-xl border border-landing-line bg-landing-panel px-6 py-5 transition-colors hover:border-[rgba(155,176,205,0.32)]"
>
<span
className="grid place-items-center w-11 h-11 rounded-lg shrink-0"
style={{ backgroundColor: `${ch.color}18`, color: ch.color }}
>
{ch.icon}
</span>
<span className="grid gap-0.5 min-w-0">
<strong className="text-[15px] font-[700] leading-snug">{meta.name}</strong>
<span className="text-landing-muted text-[13px] leading-relaxed">{meta.desc}</span>
</span>
<svg
className="ml-auto shrink-0 text-landing-muted opacity-0 -translate-x-1 transition-all group-hover:opacity-100 group-hover:translate-x-0"
width={16}
height={16}
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth={2}
strokeLinecap="round"
strokeLinejoin="round"
>
<path d="M5 12h14M12 5l7 7-7 7" />
</svg>
</a>
);
})}
</div>
</div>
</div>
);
}
+89 -103
View File
@@ -3,6 +3,7 @@ import type { CSSProperties } from 'react';
import { HeroProductStage } from '@/components/aceternity/HeroProductStage';
import { InfiniteMovingCards } from '@/components/aceternity/InfiniteMovingCards';
import { Spotlight } from '@/components/aceternity/Spotlight';
import { LandingNav } from '@/components/landing/LandingNav';
import { InstallTabs } from '@/components/landing/InstallTabs';
import { RevealSection } from '@/components/landing/RevealSection';
import {
@@ -345,15 +346,11 @@ const testimonials = {
const i18nText = {
en: {
navDocs: 'Docs',
navChangelog: 'Changelog',
navCommunity: 'Community',
lang: '中文',
eyebrow: 'Open-source database workspace',
heroTitle: 'A focused database client for daily work.',
heroTitle: '15 MB to manage 35+ databases!',
heroSubtitle:
'DBX brings connections, SQL editing, data grids, schema tools, AI assistance, and self-hosted access into one lightweight product.',
download: 'Download DBX',
downloadName: 'Download DBX',
readDocs: 'Read the docs',
docsStart: 'Start here',
docsStartDesc: 'Install DBX, create your first connection, and learn the main workflow.',
@@ -371,14 +368,10 @@ const i18nText = {
docker: 'Docker setup',
},
cn: {
navDocs: '文档',
navChangelog: '更新日志',
navCommunity: '社区',
lang: 'English',
eyebrow: '开源数据库工作台',
heroTitle: '专注日常工作的数据库客户端。',
heroTitle: '15MB,管理35+种数据库!',
heroSubtitle: 'DBX 将连接管理、SQL 编辑、数据表格、结构工具、AI 助手和自托管访问放进一个轻量产品里。',
download: '下载 DBX',
downloadName: '下载 DBX',
readDocs: '查看文档',
docsStart: '从这里开始',
docsStartDesc: '安装 DBX、创建第一个连接,并了解主要工作流。',
@@ -414,81 +407,69 @@ export default async function LandingPage({
return (
<main className="landing">
<nav className="landing-nav">
<div className="landing-nav-inner">
<Link href={`/${l}`} className="landing-logo">
<img src="/logo.png" alt="DBX" width={28} height={28} />
<span>DBX</span>
</Link>
<div className="landing-nav-links">
<Link href={`/${l}/docs/what-is-dbx`} target="_blank">
{t.navDocs}
</Link>
<Link href={`/${l}/docs/changelog`} target="_blank">
{t.navChangelog}
</Link>
<Link href="https://github.com/t8y2/dbx" target="_blank">
GitHub
</Link>
<Link href={l === 'cn' ? '/en' : '/cn'} className="landing-lang-switch">
{t.lang}
</Link>
</div>
</div>
</nav>
{/* Nav */}
<LandingNav lang={l} active="home" />
{/* Hero */}
<section className="landing-hero">
<Spotlight />
<div className="landing-hero-copy">
<div className="landing-eyebrow">{t.eyebrow}</div>
<h1>{t.heroTitle}</h1>
<p>{t.heroSubtitle}</p>
<div className="landing-hero-cta">
<Link href="https://github.com/t8y2/dbx/releases/latest" className="landing-btn-primary" target="_blank">
{t.download}
<ArrowRight size={16} />
</Link>
<Link href={`/${l}/docs/getting-started`} className="landing-btn-secondary" target="_blank">
{t.readDocs}
</Link>
<div className="relative z-[1] max-w-[1180px] mx-auto px-7 max-[1040px]:max-w-[920px] max-[760px]:px-[18px]">
<div className="landing-hero-copy relative z-[6] grid justify-items-center max-w-[900px] mx-auto text-center max-[1040px]:max-w-[760px]">
<h1 className="min-w-0 m-0 text-[clamp(36px,4.2vw,56px)] font-[820] leading-[1.06] text-landing-ink whitespace-nowrap max-[760px]:text-[clamp(26px,7vw,38px)]">
{t.heroTitle}
</h1>
<p className="landing-hero-subtitle min-w-0 mt-5 mx-auto text-[17px] font-[460] leading-[1.8] whitespace-nowrap max-[760px]:text-[15px] max-[760px]:leading-[1.68] max-[760px]:whitespace-normal max-[760px]:max-w-[320px]">
{t.heroSubtitle}
</p>
<div className="w-full max-w-[520px] mt-10">
<InstallTabs lang={l} />
</div>
</div>
<InstallTabs lang={l} />
<HeroProductStage />
</div>
<HeroProductStage />
</section>
<RevealSection className="landing-metrics">
{/* Metrics */}
<RevealSection className="grid grid-cols-4 gap-3 max-w-[1180px] mx-auto px-7 pt-6 pb-11 [animation:landing-rise_0.72s_ease-out_0.1s_both] max-[760px]:grid-cols-1 max-[760px]:px-[18px] max-[760px]:pb-8">
{metricItems.map((item) => (
<div key={item.label}>
<strong>{item.value}</strong>
<span>{item.label}</span>
<div key={item.label} data-stagger className="landing-glass-card min-h-[118px] rounded-[10px] p-[22px] max-[760px]:min-h-[96px] max-[760px]:p-[18px]">
<strong className="block text-landing-ink text-2xl font-[720]">{item.value}</strong>
<span className="block mt-1 text-landing-muted text-[13px]">{item.label}</span>
</div>
))}
</RevealSection>
<RevealSection className="landing-doc-start">
{/* Doc start */}
<RevealSection className="landing-glass-card-green flex items-center justify-between gap-[22px] max-w-[calc(1180px-56px)] mx-auto px-7 py-7 rounded-[10px] max-[760px]:block max-[760px]:px-[18px]">
<div>
<h2>{t.docsStart}</h2>
<p>{t.docsStartDesc}</p>
<h2 className="m-0 text-[25px] font-[720] text-landing-ink">{t.docsStart}</h2>
<p className="mt-2 text-landing-muted text-sm leading-[1.65]">{t.docsStartDesc}</p>
</div>
<Link href={`/${l}/docs/getting-started`} className="landing-inline-link" target="_blank">
<Link href={`/${l}/docs/getting-started`} className="landing-inline-link flex shrink-0 items-center gap-[7px] text-sm font-[650] max-[760px]:mt-4" target="_blank">
{t.readDocs}
<ArrowRight size={15} />
</Link>
</RevealSection>
<RevealSection className="landing-section">
<div className="landing-section-heading">
<h2>{t.workflowsTitle}</h2>
<p>{t.workflowsDesc}</p>
{/* Workflows */}
<RevealSection className="max-w-[1180px] mx-auto px-7 pt-[70px] pb-1 max-[760px]:px-[18px]">
<div className="grid grid-cols-[minmax(220px,0.42fr)_minmax(0,0.58fr)] gap-9 items-end mb-[22px] max-[760px]:block">
<h2 className="m-0 text-[25px] font-[720] text-landing-ink">{t.workflowsTitle}</h2>
<p className="mt-2 max-w-[650px] text-landing-muted text-sm leading-[1.65] justify-self-end text-right max-[760px]:max-w-none max-[760px]:text-left">{t.workflowsDesc}</p>
</div>
<div className="landing-workflow-grid">
{workflowItems.map((item) => (
<Link key={item.title} href={item.href} className="landing-workflow-card" target="_blank">
<item.icon size={20} />
<h3>{item.title}</h3>
<p>{item.desc}</p>
<span>
<div className="landing-workflow-grid grid grid-cols-4 rounded-[10px] overflow-hidden max-[1040px]:grid-cols-2 max-[760px]:grid-cols-1">
{workflowItems.map((item, i) => (
<Link
key={item.title}
href={item.href}
className={`landing-workflow-card min-h-[250px] p-6 border-r border-r-landing-line max-[760px]:min-h-0 max-[760px]:border-r-0 max-[760px]:border-b max-[760px]:border-b-landing-line max-[760px]:last:border-b-0 ${i === workflowItems.length - 1 ? 'border-r-0' : ''}`}
target="_blank"
data-stagger
>
<item.icon size={20} className="text-landing-blue" />
<h3 className="mt-[18px] text-base font-bold">{item.title}</h3>
<p className="mt-2.5 text-landing-muted text-[13px] leading-[1.62]">{item.desc}</p>
<span className="inline-flex items-center gap-1.5 mt-[18px] text-landing-ink text-[13px] font-[650]">
{t.readDocs}
<ArrowRight size={14} />
</span>
@@ -497,78 +478,83 @@ export default async function LandingPage({
</div>
</RevealSection>
<RevealSection className="landing-section landing-support">
<div className="landing-section-heading">
<h2>{t.supportTitle}</h2>
<p>{t.supportDesc}</p>
{/* Database support */}
<RevealSection className="relative max-w-[1180px] mx-auto px-7 pt-[70px] pb-1 max-[760px]:px-[18px]">
<div className="grid grid-cols-[minmax(260px,0.28fr)_minmax(0,0.72fr)] gap-9 items-end mb-[30px] max-[760px]:block">
<h2 className="m-0 text-[25px] font-[720] text-landing-ink">{t.supportTitle}</h2>
<p className="mt-2 max-w-[760px] text-landing-muted text-sm leading-[1.65] justify-self-end text-right max-[760px]:max-w-none max-[760px]:text-left">{t.supportDesc}</p>
</div>
<div className="landing-db-grid">
<div className="grid grid-cols-8 gap-3 max-[760px]:grid-cols-2 max-[760px]:gap-2.5 max-[760px]:mt-[18px]">
{databaseSupport.map((db) => (
<div className="landing-db-card" key={db.name} style={{ '--db-tone': db.tone } as CSSProperties}>
<div className="landing-db-icon">
{db.icon ? <img src={db.icon} alt="" width={42} height={42} /> : <span>{db.initials}</span>}
<div className="landing-db-card grid place-items-center min-h-[126px] rounded-[10px] px-2.5 py-[18px] max-[760px]:min-h-[122px] max-[760px]:py-4" key={db.name} style={{ '--db-tone': db.tone } as CSSProperties} data-stagger>
<div className="landing-db-icon grid place-items-center w-12 h-12 mb-[15px]">
{db.icon ? <img src={db.icon} alt="" width={38} height={38} className="block w-[38px] h-[38px] object-contain" /> : <span className="grid place-items-center min-w-[46px] h-8 rounded-lg px-2 text-white text-xs font-[780]">{db.initials}</span>}
</div>
<strong>{db.name}</strong>
<strong className="text-sm font-[650] leading-[1.2] text-center text-[color-mix(in_srgb,var(--color-landing-ink)_92%,var(--color-landing-muted))]">{db.name}</strong>
</div>
))}
</div>
</RevealSection>
<RevealSection className="landing-section landing-testimonials">
<div className="landing-section-heading">
<h2>{t.testimonialsTitle}</h2>
<p>{t.testimonialsDesc}</p>
{/* Testimonials */}
<RevealSection className="max-w-[1180px] mx-auto px-7 pt-[70px] pb-1 overflow-hidden max-[760px]:px-[18px]">
<div className="grid grid-cols-[minmax(220px,0.42fr)_minmax(0,0.58fr)] gap-9 items-end mb-[22px] max-[760px]:block">
<h2 className="m-0 text-[25px] font-[720] text-landing-ink">{t.testimonialsTitle}</h2>
<p className="mt-2 max-w-[650px] text-landing-muted text-sm leading-[1.65] justify-self-end text-right max-[760px]:max-w-none max-[760px]:text-left">{t.testimonialsDesc}</p>
</div>
<div className="landing-testimonial-wall">
<div className="landing-testimonial-wall relative grid gap-3.5 -mx-7 py-1 max-[760px]:-mx-[18px] max-[760px]:mt-[18px]">
<InfiniteMovingCards items={testimonialItems.slice(0, 6)} speed="slow" />
<InfiniteMovingCards items={testimonialItems.slice(6)} direction="right" speed="slow" />
</div>
</RevealSection>
<RevealSection className="landing-section">
<div className="landing-section-heading">
<h2>{t.capabilitiesTitle}</h2>
{/* Capabilities */}
<RevealSection className="max-w-[1180px] mx-auto px-7 pt-[70px] pb-1 max-[760px]:px-[18px]">
<div className="grid grid-cols-[minmax(220px,0.42fr)_minmax(0,0.58fr)] gap-9 items-end mb-[22px] max-[760px]:block">
<h2 className="m-0 text-[25px] font-[720] text-landing-ink">{t.capabilitiesTitle}</h2>
</div>
<div className="landing-capability-grid">
<div className="grid grid-cols-3 gap-2.5 max-[1040px]:grid-cols-2 max-[760px]:grid-cols-1 max-[760px]:mt-[18px]">
{capabilityItems.map((item) => (
<div key={item.label} className="landing-capability">
<item.icon size={18} />
<span>{item.label}</span>
<div key={item.label} className="landing-capability flex items-center gap-2.5 min-h-[72px] rounded-lg px-[15px] py-3.5" data-stagger>
<item.icon size={18} className="shrink-0 text-landing-blue" />
<span className="text-landing-ink text-[13px] font-[560] leading-[1.45]">{item.label}</span>
</div>
))}
</div>
</RevealSection>
<RevealSection className="landing-updates">
<div className="landing-update-version">{latest.version}</div>
<div className="landing-update-copy">
<h2>{latest.title}</h2>
<p>{latest.desc}</p>
{/* Updates */}
<RevealSection className="grid grid-cols-[minmax(86px,0.16fr)_minmax(210px,0.32fr)_minmax(0,0.38fr)_max-content] gap-[22px] items-center max-w-[1180px] mx-auto px-7 border-t border-b border-landing-line mt-[62px] py-6 max-[1040px]:grid-cols-[minmax(0,1fr)_max-content] max-[760px]:block max-[760px]:px-[18px]">
<div className="landing-update-version w-max rounded-[7px] px-2.5 py-[7px] text-[13px] font-[720]">{latest.version}</div>
<div className="max-[1040px]:col-span-full max-[760px]:mt-4">
<h2 className="m-0 text-[21px] font-[720] text-landing-ink">{latest.title}</h2>
<p className="mt-1.5 text-landing-muted text-[13px] leading-[1.55]">{latest.desc}</p>
</div>
<ul className="landing-update-list">
<ul className="grid gap-2 m-0 p-0 list-none max-[1040px]:col-span-full max-[760px]:mt-4">
{latest.items.map((item) => (
<li key={item}>
<CheckCircle2 size={14} />
<li key={item} className="flex gap-2 items-center text-[13px] font-[560] leading-[1.45] text-[color-mix(in_srgb,var(--color-landing-ink)_88%,var(--color-landing-muted))]" data-stagger>
<CheckCircle2 size={14} className="shrink-0 text-landing-green" />
<span>{item}</span>
</li>
))}
</ul>
<Link href={`/${l}/docs/changelog`} className="landing-inline-link" target="_blank">
<Link href={`/${l}/changelog`} className="landing-inline-link flex shrink-0 items-center gap-[7px] text-sm font-[650] max-[760px]:mt-4">
{latest.link}
<ArrowRight size={15} />
</Link>
</RevealSection>
<RevealSection className="landing-final">
{/* Final CTA */}
<RevealSection className="flex items-center justify-between gap-6 max-w-[1180px] mx-auto px-7 border border-landing-line rounded-[10px] bg-landing-panel mt-[72px] mb-14 py-[30px] max-[760px]:block max-[760px]:px-[18px]">
<div>
<h2>{t.footerTitle}</h2>
<p>{t.footerDesc}</p>
<h2 className="m-0 text-[25px] font-[720] text-landing-ink">{t.footerTitle}</h2>
<p className="mt-2 text-landing-muted text-sm leading-[1.65]">{t.footerDesc}</p>
</div>
<div className="landing-final-actions">
<Link href="https://github.com/t8y2/dbx/releases/latest" target="_blank">
<div className="flex items-center gap-2.5 flex-wrap justify-end max-[760px]:mt-[18px]">
<Link href="https://github.com/t8y2/dbx/releases/latest" target="_blank" className="landing-final-link inline-flex items-center justify-center min-h-[42px] rounded-[7px] px-[15px] text-sm font-[650]">
{t.release}
</Link>
<Link href={`/${l}/docs/getting-started#docker`} target="_blank">
<Link href={`/${l}/docs/getting-started#docker`} target="_blank" className="landing-final-link inline-flex items-center justify-center min-h-[42px] rounded-[7px] px-[15px] text-sm font-[650]">
{t.docker}
</Link>
</div>
+313 -890
View File
File diff suppressed because it is too large Load Diff
@@ -1,21 +1,76 @@
'use client';
import { motion } from 'motion/react';
import { useEffect, useState } from 'react';
const productSlides = [
{
src: '/screenshot-dark.png',
alt: 'DBX data grid and AI assistant screenshot',
label: 'Data grid',
},
{
src: '/screenshot-connections.jpg',
alt: 'DBX connection management screenshot',
label: 'Connections',
},
{
src: '/screenshot-grid.png',
alt: 'DBX table data grid screenshot',
label: 'Tables',
},
{
src: '/screenshot-ai.jpg',
alt: 'DBX AI assistant screenshot',
label: 'AI',
},
];
export function HeroProductStage() {
const [activeSlide, setActiveSlide] = useState(0);
useEffect(() => {
const timer = window.setInterval(() => {
setActiveSlide((current) => (current + 1) % productSlides.length);
}, 4200);
return () => window.clearInterval(timer);
}, []);
return (
<motion.div
className="landing-product"
initial={{ opacity: 0, y: 28, rotateX: 4, rotateY: -6 }}
animate={{ opacity: 1, y: 0, rotateX: 0, rotateY: 0 }}
transition={{ duration: 0.9, delay: 0.12, ease: [0.16, 1, 0.3, 1] }}
className="landing-product relative w-full mt-16 mb-12 overflow-hidden rounded-2xl max-[1040px]:max-w-[900px] max-[1040px]:mt-14 max-[760px]:mt-10 max-[760px]:mb-7 max-[760px]:rounded-xl"
initial={{ opacity: 0, y: 36, scale: 0.985 }}
animate={{ opacity: 1, y: 0, scale: 1 }}
transition={{ duration: 0.9, delay: 0.18, ease: [0.16, 1, 0.3, 1] }}
>
<div className="landing-window-bar">
<span />
<span />
<span />
<div className="relative aspect-[16/10] overflow-hidden">
{productSlides.map((slide, index) => (
<img
alt={slide.alt}
aria-hidden={index !== activeSlide}
className="landing-product-slide absolute inset-0 z-[1] w-full h-full object-cover object-left-top"
data-active={index === activeSlide}
key={slide.src}
src={slide.src}
/>
))}
</div>
<div className="landing-product-dots absolute right-[18px] bottom-4 z-[5] flex gap-[7px] items-center rounded-full p-1.5 max-[760px]:right-3 max-[760px]:bottom-[11px]" aria-label="DBX product screenshots">
{productSlides.map((slide, index) => (
<button
aria-current={index === activeSlide}
aria-label={`Show ${slide.label} screenshot`}
key={slide.src}
onClick={() => setActiveSlide(index)}
title={slide.label}
type="button"
className="block w-[9px] h-[9px] border-0 rounded-full p-0 cursor-pointer"
>
<span>{slide.label}</span>
</button>
))}
</div>
<img src="/screenshot-dark.png" alt="DBX product screenshot" />
</motion.div>
);
}
@@ -18,22 +18,22 @@ export function InfiniteMovingCards({ items, direction = 'left', speed = 'normal
return (
<div
className="landing-testimonial-marquee"
className="landing-testimonial-marquee flex overflow-hidden select-none"
data-direction={direction}
data-speed={speed}
aria-label="Testimonials"
>
<div className="landing-testimonial-track">
<div className="landing-testimonial-track flex w-max min-w-full gap-3.5 px-[7px]">
{repeatedItems.map((item, index) => (
<figure className="landing-testimonial-card" key={`${item.name}-${index}`}>
<div className="landing-testimonial-author">
<img className="landing-testimonial-avatar" src={item.avatar} alt="" width={42} height={42} />
<figure className="landing-testimonial-card flex-[0_0_340px] min-h-[188px] rounded-[9px] m-0 p-[22px] max-[760px]:flex-[0_0_286px] max-[760px]:min-h-[210px] max-[760px]:p-[18px]" key={`${item.name}-${index}`}>
<div className="flex gap-3 items-center">
<img className="w-[42px] h-[42px] shrink-0 border border-[rgba(178,200,230,0.18)] rounded-full bg-[rgba(255,255,255,0.04)] object-cover" src={item.avatar} alt="" width={42} height={42} />
<figcaption>
<strong>{item.name}</strong>
<span>{item.role}</span>
<strong className="block text-landing-ink text-[15px] font-[740] leading-[1.25]">{item.name}</strong>
<span className="block mt-[3px] text-landing-muted text-xs leading-[1.35]">{item.role}</span>
</figcaption>
</div>
<blockquote>{item.quote}</blockquote>
<blockquote className="mt-[18px] text-sm font-[560] leading-[1.58] text-[color-mix(in_srgb,var(--color-landing-ink)_88%,var(--color-landing-muted))]">{item.quote}</blockquote>
</figure>
))}
</div>
+121
View File
@@ -0,0 +1,121 @@
'use client';
import { useState, useEffect, useRef } from 'react';
import type { ChangelogRelease } from '@/lib/changelog';
import { ChevronDown, Tag } from 'lucide-react';
const PAGE_SIZE = 5;
const sectionLabels: Record<string, Record<string, string>> = {
added: { en: 'New Features', cn: '新功能' },
improved: { en: 'Improvements', cn: '改进' },
fixed: { en: 'Bug Fixes', cn: '问题修复' },
changed: { en: 'Changes', cn: '变更' },
removed: { en: 'Removed', cn: '移除' },
};
function formatDate(dateStr: string, lang: string) {
const d = new Date(dateStr);
if (lang === 'cn') {
return `${d.getFullYear()}年${d.getMonth() + 1}月${d.getDate()}日`;
}
return d.toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric' });
}
function ReleaseCard({ release, lang }: { release: ChangelogRelease; lang: string }) {
const t = lang === 'cn'
? { publishedOn: '发布于', download: '下载', seeGitHub: '查看 GitHub Release 获取详情' }
: { publishedOn: 'Published on', download: 'Download', seeGitHub: 'See GitHub Release for details' };
return (
<div className="py-12 border-t border-[rgba(155,176,205,0.18)]">
{/* Header */}
<div className="flex items-center justify-between gap-4 mb-8">
<div className="flex items-center gap-4">
<span className="flex items-center gap-1.5 px-3.5 py-1.5 rounded-full border border-[rgba(155,176,205,0.25)] text-sm font-semibold text-[#e2e8f0]">
<Tag size={13} className="text-[#6ea8ff]" />
{release.tag.replace('v', '')}
</span>
<span className="text-[15px] text-[#64748b]">
{t.publishedOn} {formatDate(release.date, lang)}
</span>
</div>
<a
href={`https://github.com/t8y2/dbx/releases/tag/${release.tag}`}
target="_blank"
rel="noopener noreferrer"
className="flex items-center gap-1.5 px-4 py-2 rounded-full border border-[rgba(155,176,205,0.25)] text-sm text-[#e2e8f0] hover:border-[rgba(155,176,205,0.4)] transition-colors"
>
{t.download}
<ChevronDown size={14} />
</a>
</div>
{/* Title */}
<h2 className="text-[28px] font-[720] text-[#f7fbff] mb-10">
Release {release.tag}
</h2>
{/* Sections */}
{release.sections.map((section, si) => (
<div key={si} className={si > 0 ? 'mt-10' : ''}>
<h3 className="text-xl font-bold text-[#f7fbff] mb-5">
{sectionLabels[section.type]?.[lang] || section.title}
</h3>
<ul className="space-y-3">
{section.items.map((item, ii) => (
<li key={ii} className="flex gap-3 text-[15px] leading-relaxed text-[#b8c5d6]">
<span className="mt-2 w-1.5 h-1.5 rounded-full bg-[#475569] shrink-0" />
<span>
{item.desc ? <>{item.title},{item.desc}</> : item.title}
</span>
</li>
))}
</ul>
</div>
))}
{release.sections.length === 0 && (
<p className="text-[15px] text-[#64748b] italic">{t.seeGitHub}</p>
)}
</div>
);
}
export function ChangelogList({ releases, lang }: { releases: ChangelogRelease[]; lang: string }) {
const [count, setCount] = useState(PAGE_SIZE);
const sentinelRef = useRef<HTMLDivElement>(null);
useEffect(() => {
const node = sentinelRef.current;
if (!node) return;
const observer = new IntersectionObserver(
([entry]) => {
if (entry.isIntersecting) {
setCount((c) => Math.min(c + PAGE_SIZE, releases.length));
}
},
{ rootMargin: '200px' },
);
observer.observe(node);
return () => observer.disconnect();
}, [releases.length]);
const visible = releases.slice(0, count);
const hasMore = count < releases.length;
return (
<>
{visible.map((release) => (
<ReleaseCard key={release.tag} release={release} lang={lang} />
))}
{hasMore && (
<div ref={sentinelRef} className="flex justify-center py-12 text-[#64748b] text-sm">
{lang === 'cn' ? '加载更多版本…' : 'Loading more versions…'}
</div>
)}
</>
);
}
+103 -103
View File
@@ -1,127 +1,127 @@
'use client';
import { Check, Copy, ExternalLink } from 'lucide-react';
import { useState } from 'react';
import { ChevronDown, Download, Server } from 'lucide-react';
import { useEffect, useMemo, useState } from 'react';
type InstallTabsProps = {
lang: 'en' | 'cn';
};
const releaseUrl = 'https://github.com/t8y2/dbx/releases/latest';
type InstallOption = {
id: string;
label: string;
href: string;
};
const installOptions = {
const allOptions: Record<string, InstallOption[]> = {
en: [
{
id: 'macos',
label: 'macOS',
note: 'Homebrew',
command: 'brew install --cask t8y2/tap/dbx',
linkText: 'GitHub Releases',
},
{
id: 'windows',
label: 'Windows',
note: 'Scoop',
command: 'scoop bucket add dbx https://github.com/t8y2/scoop-bucket; scoop install dbx',
linkText: 'GitHub Releases',
},
{
id: 'linux',
label: 'Linux',
note: '.deb / AppImage',
command: 'chmod +x DBX*.AppImage',
linkText: 'Download packages',
},
{
id: 'docker',
label: 'Docker',
note: 'Self-hosted',
command: 'docker run -d --name dbx -p 4224:4224 -v dbx-data:/app/data t8y2/dbx',
linkText: 'Docker docs',
href: '/en/docs/getting-started#docker',
},
{ id: 'macos-arm', label: 'For macOS (Apple Silicon)', href: 'https://dl.dbxio.com/releases/latest/DBX_0.5.9_aarch64.dmg' },
{ id: 'macos-intel', label: 'For macOS (Intel)', href: 'https://dl.dbxio.com/releases/latest/DBX_0.5.9_x64.dmg' },
{ id: 'windows', label: 'For Windows', href: 'https://dl.dbxio.com/releases/latest/DBX_0.5.9_x64-setup.exe' },
{ id: 'linux', label: 'For Linux x64', href: 'https://dl.dbxio.com/releases/latest/DBX_0.5.9_amd64.AppImage' },
{ id: 'linux-arm', label: 'For Linux ARM64', href: 'https://dl.dbxio.com/releases/latest/DBX_0.5.9_aarch64.AppImage' },
],
cn: [
{
id: 'macos',
label: 'macOS',
note: 'Homebrew',
command: 'brew install --cask t8y2/tap/dbx',
linkText: 'GitHub Releases',
},
{
id: 'windows',
label: 'Windows',
note: 'Scoop',
command: 'scoop bucket add dbx https://github.com/t8y2/scoop-bucket; scoop install dbx',
linkText: 'GitHub Releases',
},
{
id: 'linux',
label: 'Linux',
note: '.deb / AppImage',
command: 'chmod +x DBX*.AppImage',
linkText: '下载安装包',
},
{
id: 'docker',
label: 'Docker',
note: '自托管',
command: 'docker run -d --name dbx -p 4224:4224 -v dbx-data:/app/data t8y2/dbx',
linkText: 'Docker 文档',
href: '/cn/docs/getting-started#docker',
},
{ id: 'macos-arm', label: '适用于 macOS (Apple Silicon)', href: 'https://dl.dbxio.com/releases/latest/DBX_0.5.9_aarch64.dmg' },
{ id: 'macos-intel', label: '适用于 macOS (Intel)', href: 'https://dl.dbxio.com/releases/latest/DBX_0.5.9_x64.dmg' },
{ id: 'windows', label: '适用于 Windows', href: 'https://dl.dbxio.com/releases/latest/DBX_0.5.9_x64-setup.exe' },
{ id: 'linux', label: '适用于 Linux x64', href: 'https://dl.dbxio.com/releases/latest/DBX_0.5.9_amd64.AppImage' },
{ id: 'linux-arm', label: '适用于 Linux ARM64', href: 'https://dl.dbxio.com/releases/latest/DBX_0.5.9_aarch64.AppImage' },
],
};
export function InstallTabs({ lang }: InstallTabsProps) {
const options = installOptions[lang];
const [activeId, setActiveId] = useState(options[0].id);
const [copied, setCopied] = useState(false);
const active = options.find((item) => item.id === activeId) ?? options[0];
const downloadLabel = { en: 'Download DBX', cn: '下载 DBX' };
async function copyCommand() {
await navigator.clipboard.writeText(active.command);
setCopied(true);
window.setTimeout(() => setCopied(false), 1600);
}
const platformIconPaths = {
dark: {
'linux-arm': '/icons/platform/linux.svg',
linux: '/icons/platform/linux.svg',
'macos-arm': '/icons/platform/macos.png',
'macos-intel': '/icons/platform/macos.png',
windows: '/icons/platform/windows.png',
},
light: {
'linux-arm': '/icons/platform/linux.svg',
linux: '/icons/platform/linux.svg',
'macos-arm': '/icons/platform/macos-white.png',
'macos-intel': '/icons/platform/macos-white.png',
windows: '/icons/platform/windows.png',
},
};
function detectPlatformId(): string {
if (typeof navigator === 'undefined') return 'macos-arm';
const ua = navigator.userAgent.toLowerCase();
if (ua.includes('win')) return 'windows';
if (ua.includes('linux')) return ua.includes('aarch64') || ua.includes('arm') ? 'linux-arm' : 'linux';
return 'macos-arm';
}
function PlatformIcon({ id, size, variant }: { id: string; size: number; variant: 'dark' | 'light' }) {
const src = platformIconPaths[variant][id as keyof (typeof platformIconPaths)['dark']];
if (!src) return <Server size={size} />;
return <img alt="" aria-hidden="true" height={size} src={src} width={size} />;
}
export function InstallTabs({ lang }: InstallTabsProps) {
const options = allOptions[lang];
const [open, setOpen] = useState(false);
const [platformId, setPlatformId] = useState('macos-arm');
useEffect(() => {
setPlatformId(detectPlatformId());
}, []);
const primary = useMemo(() => options.find((o) => o.id === platformId) ?? options[0], [options, platformId]);
const menuOptions = useMemo(() => options.filter((o) => o.id !== platformId), [options, platformId]);
return (
<div className="landing-install">
<div className="landing-install-tabs" role="tablist" aria-label={lang === 'cn' ? '安装平台' : 'Install platform'}>
{options.map((item) => (
<button
aria-selected={item.id === active.id}
className="landing-install-tab"
<div
className="landing-install relative z-20 block w-fit max-w-full mx-auto"
data-open={open}
onBlur={(event) => {
if (!event.currentTarget.contains(event.relatedTarget)) {
setOpen(false);
}
}}
onMouseEnter={() => setOpen(true)}
onMouseLeave={() => setOpen(false)}
>
<a
aria-controls="landing-install-menu"
aria-expanded={open}
aria-haspopup="listbox"
className="landing-install-trigger grid grid-cols-[auto_minmax(0,1fr)_auto] gap-4 items-center w-[min(340px,calc(100vw-48px))] min-h-[68px] border-0 rounded-full mx-auto px-6 cursor-pointer"
href={primary.href}
onFocus={() => setOpen(true)}
>
<PlatformIcon id={primary.id} size={30} variant="dark" />
<span className="grid gap-0.5 min-w-0">
<strong className="overflow-hidden text-[15px] font-[780] leading-[1.2] truncate">{downloadLabel[lang]}</strong>
<small className="overflow-hidden text-xs font-[520] leading-tight truncate text-[color-mix(in_srgb,#0f172a_48%,#94a3b8)]">{primary.label}</small>
</span>
<ChevronDown size={18} />
</a>
<div
className="landing-install-menu absolute z-30 top-[calc(100%+12px)] left-1/2 -translate-x-1/2 grid w-[min(300px,calc(100vw-48px))] border border-[rgba(155,176,205,0.17)] rounded-xl py-1.5"
id="landing-install-menu"
role="listbox"
aria-label={lang === 'cn' ? '下载选项' : 'Download options'}
>
{menuOptions.map((item) => (
<a
aria-selected="false"
className="landing-install-option grid grid-cols-[24px_minmax(0,1fr)_18px] gap-3 items-center min-w-0 border-0 px-[18px] py-3 bg-transparent text-left cursor-pointer"
href={item.href}
key={item.id}
onClick={() => {
setActiveId(item.id);
setCopied(false);
}}
role="tab"
type="button"
role="option"
>
<span>{item.label}</span>
<small>{item.note}</small>
</button>
<PlatformIcon id={item.id} size={20} variant="light" />
<strong className="overflow-hidden text-sm font-[640] leading-[1.2] truncate">{item.label}</strong>
<Download size={15} aria-hidden="true" />
</a>
))}
</div>
<div className="landing-install-command">
<code>{active.command}</code>
<button
aria-label={lang === 'cn' ? '复制安装命令' : 'Copy install command'}
className="landing-install-copy"
onClick={copyCommand}
title={lang === 'cn' ? '复制安装命令' : 'Copy install command'}
type="button"
>
{copied ? <Check size={16} /> : <Copy size={16} />}
</button>
</div>
<a className="landing-install-release" href={active.href ?? releaseUrl} target="_blank">
{active.linkText}
<ExternalLink size={14} />
</a>
</div>
);
}
+89
View File
@@ -0,0 +1,89 @@
'use client';
import Link from 'next/link';
import { useEffect, useRef } from 'react';
const i18n = {
en: { home: 'Home', docs: 'Docs', changelog: 'Changelog', community: 'Community', lang: '中文' },
cn: { home: '首页', docs: '文档', changelog: '更新日志', community: '交流群', lang: 'English' },
};
export function LandingNav({
lang,
active,
}: {
lang: 'en' | 'cn';
active?: 'home' | 'changelog' | 'community';
}) {
const ref = useRef<HTMLElement>(null);
const t = i18n[lang];
const otherLang = lang === 'cn' ? 'en' : 'cn';
const langHrefMap: Record<string, string> = {
changelog: `/${otherLang}/changelog`,
community: `/${otherLang}/community`,
};
const langHref = langHrefMap[active ?? ''] ?? `/${otherLang}`;
useEffect(() => {
const node = ref.current;
if (!node) return;
function onScroll() {
node!.classList.toggle('is-scrolled', window.scrollY > 60);
}
onScroll();
window.addEventListener('scroll', onScroll, { passive: true });
return () => window.removeEventListener('scroll', onScroll);
}, []);
return (
<nav ref={ref} className="landing-nav">
<div className="flex items-center justify-between max-w-[1180px] h-16 mx-auto px-7 max-[760px]:min-h-[58px] max-[760px]:h-auto max-[760px]:px-[18px] max-[760px]:py-2.5">
<Link href={`/${lang}`} className="flex items-center gap-2.5 text-landing-ink text-2xl font-[820]">
<img src="/logo.png" alt="DBX" width={28} height={28} />
<span>DBX</span>
</Link>
<div className="flex items-center gap-1">
<Link
href={`/${lang}`}
className={`landing-nav-link rounded-[7px] px-[11px] py-2 text-[13px] font-medium max-[760px]:hidden ${active === 'home' ? 'text-landing-ink' : 'text-landing-muted'}`}
>
{t.home}
</Link>
<Link
href={`/${lang}/docs/what-is-dbx`}
className="landing-nav-link rounded-[7px] px-[11px] py-2 text-[13px] font-medium max-[760px]:hidden text-landing-muted"
>
{t.docs}
</Link>
<Link
href={`/${lang}/changelog`}
className={`landing-nav-link rounded-[7px] px-[11px] py-2 text-[13px] font-medium max-[760px]:hidden ${active === 'changelog' ? 'text-landing-ink' : 'text-landing-muted'}`}
>
{t.changelog}
</Link>
<Link
href={`/${lang}/community`}
className={`landing-nav-link rounded-[7px] px-[11px] py-2 text-[13px] font-medium max-[760px]:hidden ${active === 'community' ? 'text-landing-ink' : 'text-landing-muted'}`}
>
{t.community}
</Link>
<Link
href="https://github.com/t8y2/dbx"
target="_blank"
className="landing-nav-link rounded-[7px] px-[11px] py-2 text-landing-muted text-[13px] font-medium max-[760px]:hidden"
>
GitHub
</Link>
<Link
href={langHref}
className="landing-nav-link rounded-[7px] px-[11px] py-2 text-landing-muted text-[13px] font-medium ml-1.5 border border-landing-line"
>
{t.lang}
</Link>
</div>
</div>
</nav>
);
}
-1
View File
@@ -3,7 +3,6 @@
"pages": [
"---Introduction---",
"what-is-dbx",
"changelog",
"getting-started",
"databases",
"---Core Features---",
+38
View File
@@ -0,0 +1,38 @@
export type ChangelogItem = {
title: string;
desc: string;
};
export type ChangelogSection = {
type: string;
title: string;
items: ChangelogItem[];
};
export type ChangelogRelease = {
tag: string;
name: string;
date: string;
sections: ChangelogSection[];
};
export type ChangelogData = {
updatedAt: string;
releases: ChangelogRelease[];
};
const BASE_URL = process.env.CHANGELOG_BASE_URL || 'https://dl.dbxio.com/changelog';
export async function fetchChangelog(lang: 'en' | 'cn'): Promise<ChangelogData> {
const url = `${BASE_URL}/releases-${lang}.json`;
try {
const res = await fetch(url, { next: { revalidate: 3600 } });
if (!res.ok) {
return { updatedAt: '', releases: [] };
}
return res.json() as Promise<ChangelogData>;
} catch {
return { updatedAt: '', releases: [] };
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
import "./.next/dev/types/routes.d.ts";
import "./.next/types/routes.d.ts";
// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

+15
View File
@@ -0,0 +1,15 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12.2665 9.498L12.3491 11.3984L11.0271 13.8771L8.96146 17.9257L8.54834 21.3134L10.0356 26.1056L13.4232 28.006H18.546L23.3382 24.3705L25.4865 18.6694L20.529 12.6377L19.1243 9.25012L12.2665 9.498Z" fill="#ECEFF1"/>
<path d="M23.9993 14.2076C22.6773 12.3072 21.6032 11.1505 21.0248 8.75436C20.4464 6.35824 21.1901 7.01924 20.6943 4.95362C20.4464 3.87949 20.0333 3.13587 19.6202 2.55749C19.1244 1.97912 18.5461 1.64862 18.2156 1.56599C17.4719 1.15287 15.7368 0.491866 13.5886 1.64862C11.3577 2.80537 11.6056 5.28412 12.0187 10.3242C12.0187 10.6547 11.9361 11.0679 11.7708 11.3984C11.4403 12.142 10.8619 12.803 10.3662 13.3814C9.78781 14.2076 9.20943 15.0339 8.79631 15.9427C7.80481 17.8431 6.89593 20.2392 7.14381 21.1481C7.55693 21.0655 12.7623 28.9975 12.7623 29.1627C13.0928 29.0801 14.4974 29.0801 15.7368 29.0801C17.4719 28.9975 18.4634 28.9149 19.8681 29.2454C19.8681 28.9975 19.7854 28.7496 19.7854 28.5017C19.7854 28.006 19.8681 27.5929 19.9507 27.0145C20.0333 26.6014 20.1159 26.1882 20.1986 25.6925C19.3723 26.4361 17.8851 27.2624 16.4804 27.5102C15.2411 27.7581 13.1754 27.345 12.1839 26.1056C12.2666 26.1056 12.4318 26.1056 12.5144 26.023C12.7623 25.9404 13.0102 25.8577 13.0928 25.6925C13.3407 25.2794 13.1754 24.8662 13.0102 24.6184C12.8449 24.3705 11.6056 23.4616 11.0272 22.9659C10.4488 22.4701 10.1183 22.2222 9.78781 21.8917C9.78781 21.8917 9.29206 21.396 9.12681 21.2307C8.96156 21.0655 8.87893 20.9002 8.79631 20.8176C8.63106 20.4045 8.54843 19.9087 8.63106 19.2477C8.71368 18.3389 9.04418 17.5952 9.45731 16.769C9.62256 16.4385 10.0357 15.7775 10.0357 15.7775C10.0357 15.7775 8.63106 19.2477 9.37468 20.3219C9.37468 20.3219 9.45731 19.2477 9.78781 18.1736C10.0357 17.43 10.4488 16.3559 10.9446 15.7775C11.4403 15.1991 12.6797 13.0509 12.7623 11.7289C12.7623 11.1505 12.8449 10.5721 12.8449 10.159C12.5144 9.82849 18.2982 9.00224 18.6287 9.91112C18.7113 10.2416 19.8681 13.2161 20.5291 14.786C20.8596 15.5296 21.2727 16.1906 21.5206 17.0169C21.7684 17.9257 21.9337 19.1651 21.9337 20.4045C21.9337 20.6524 21.9337 21.0655 21.8511 21.4786C22.0163 21.4786 25.2387 18.0084 21.4379 15.1165C21.4379 15.1165 23.7514 16.1906 23.8341 18.3389C23.9167 20.074 23.1731 21.4786 23.0078 21.7265C23.0904 21.7265 24.7429 22.4701 24.8256 22.4701C25.1561 22.4701 25.8171 22.2222 25.8171 22.2222C25.8997 21.9744 26.1476 21.3134 26.1476 21.0655C26.7259 19.1651 25.3213 16.108 23.9993 14.2076Z" fill="#263238"/>
<path d="M13.5058 8.75434C14.099 8.75434 14.5799 8.01449 14.5799 7.10184C14.5799 6.18919 14.099 5.44934 13.5058 5.44934C12.9125 5.44934 12.4316 6.18919 12.4316 7.10184C12.4316 8.01449 12.9125 8.75434 13.5058 8.75434Z" fill="#ECEFF1"/>
<path d="M17.224 8.91965C17.9997 8.91965 18.6286 8.06882 18.6286 7.01927C18.6286 5.96972 17.9997 5.1189 17.224 5.1189C16.4482 5.1189 15.8193 5.96972 15.8193 7.01927C15.8193 8.06882 16.4482 8.91965 17.224 8.91965Z" fill="#ECEFF1"/>
<path d="M14.1058 7.2149C14.0371 6.67164 13.7246 6.26371 13.4077 6.30377C13.0908 6.34382 12.8895 6.8167 12.9582 7.35996C13.0269 7.90322 13.3394 8.31116 13.6563 8.2711C13.9732 8.23104 14.1745 7.75817 14.1058 7.2149Z" fill="#212121"/>
<path d="M17.1417 8.42388C17.598 8.42388 17.9679 7.94298 17.9679 7.34976C17.9679 6.75654 17.598 6.27563 17.1417 6.27563C16.6854 6.27563 16.3154 6.75654 16.3154 7.34976C16.3154 7.94298 16.6854 8.42388 17.1417 8.42388Z" fill="#212121"/>
<path d="M28.1305 25.5272C27.8 25.3619 27.2216 25.1141 26.7259 24.3704C26.478 23.9573 26.5606 22.8006 26.1475 22.3048C25.8996 21.9743 25.5691 22.1396 25.4865 22.1396C24.7429 22.3048 23.0077 23.4616 21.851 22.1396C21.6857 21.9743 21.4379 21.7264 21.0247 21.7264C20.6116 21.7264 20.4464 21.8917 20.2811 22.2222C20.1159 22.5527 20.1159 22.8006 20.1159 23.6268C20.1159 24.2878 20.1159 25.0314 20.0332 25.6098C19.868 27.0144 19.6201 27.8407 19.6201 28.6669C19.6201 29.5758 19.868 30.1542 20.1985 30.4021C20.4464 30.6499 20.8595 30.8152 21.7684 30.8152C22.6772 30.8152 23.2556 30.4847 23.834 29.9063C24.2471 29.4932 24.5776 29.3279 25.7344 28.5017C26.6432 27.9233 28.0479 27.1797 28.2957 26.9318C28.461 26.7666 28.7089 26.6839 28.7089 26.1882C28.7089 25.7751 28.3784 25.6098 28.1305 25.5272Z" fill="#FFC107"/>
<path d="M11.5232 25.775C10.6969 24.453 10.6143 24.2052 10.0359 23.3789C9.54016 22.5527 8.46603 20.9828 7.80503 20.9828C7.30928 20.9828 7.06141 21.2307 6.73091 21.5612C6.40041 21.8917 6.06991 22.6353 5.49153 23.0484C4.99578 23.4615 3.59116 23.3789 3.26066 23.8747C2.93016 24.3704 3.59116 25.114 3.59116 26.3534C3.59116 26.8492 3.17803 27.1797 3.09541 27.5102C3.01278 27.9233 2.93016 28.1712 3.09541 28.5017C3.42591 28.9974 3.83903 29.1627 6.64828 29.741C8.13553 30.0715 9.54016 30.8978 10.449 30.9804C11.3579 31.063 12.9278 30.9804 12.9278 28.7495C13.0104 27.4275 12.2668 27.097 11.5232 25.775Z" fill="#FFC107"/>
<path d="M13.093 10.8199C12.5972 10.4894 12.1841 10.1589 12.1841 9.66318C12.1841 9.16743 12.5146 9.00218 13.0103 8.58905C13.093 8.50643 14.0018 7.68018 14.9107 7.68018C15.8196 7.68018 16.8937 8.25855 17.3068 8.4238C18.0505 8.58905 18.7941 8.7543 18.7115 9.33268C18.6288 10.1589 18.5462 10.3242 17.72 10.7373C17.1416 10.9026 16.0675 11.8114 15.3238 11.8114C14.9933 11.8114 14.4976 11.8114 14.1671 11.7288C13.9192 11.6462 13.5061 11.233 13.093 10.8199Z" fill="#FFC107"/>
<path d="M12.9276 10.159C13.0928 10.3242 13.3407 10.4895 13.5886 10.5721C13.7538 10.6547 14.0017 10.7374 14.0017 10.7374C14.3322 10.7374 14.5801 10.7374 14.7453 10.7374C15.1585 10.7374 15.7368 10.5721 16.3152 10.2416C16.8936 9.99373 16.9762 9.82848 17.3893 9.66323C17.8025 9.41535 18.2156 9.16748 18.0503 9.08485C17.8851 9.00223 17.7198 9.08485 17.1415 9.41535C16.6457 9.74585 16.2326 9.9111 15.7368 10.159C15.489 10.2416 15.1585 10.4069 14.9106 10.4069C14.6627 10.4069 14.4148 10.4069 14.167 10.4069C13.9191 10.4069 13.7538 10.3242 13.506 10.2416C13.3407 10.159 13.2581 10.0764 13.1755 10.0764C13.0102 9.99373 12.6797 9.66323 12.5145 9.5806C12.5145 9.5806 12.3492 9.5806 12.4318 9.66323C12.6797 9.9111 12.7623 9.99373 12.9276 10.159Z" fill="#634703"/>
<path d="M15.4062 8.34114C15.4889 8.50639 15.6541 8.50639 15.7367 8.58901C15.8194 8.67164 15.902 8.67164 15.902 8.67164C15.9846 8.58901 15.902 8.42376 15.8194 8.42376C15.8194 8.25851 15.4062 8.25851 15.4062 8.34114Z" fill="#634703"/>
<path d="M14.084 8.50642C14.084 8.58904 14.2492 8.67167 14.2492 8.58904C14.3319 8.50642 14.4145 8.42379 14.4971 8.42379C14.6624 8.34117 14.5797 8.25854 14.3319 8.25854C14.1666 8.34117 14.1666 8.42379 14.084 8.50642Z" fill="#634703"/>
<path d="M22.0991 23.131C22.0991 23.2136 22.0991 23.2963 22.0991 23.3789C22.2643 23.7094 22.6774 23.792 23.0079 23.792C23.5037 23.792 23.9994 23.4615 24.2473 23.131C24.2473 23.0484 24.3299 22.9658 24.4126 22.8831C24.5778 22.6353 24.6604 22.47 24.7431 22.3874C24.7431 22.3874 24.6604 22.3048 24.6604 22.2221C24.5778 22.0569 24.3299 21.8916 23.9994 21.809C23.7516 21.7264 23.3384 21.6438 23.1732 21.6438C22.4296 21.5611 22.0164 21.809 21.7686 22.0569C21.7686 22.0569 21.8512 22.0569 21.8512 22.1395C22.0164 22.3048 22.0991 22.47 22.0991 22.7179C22.1817 22.8831 22.0991 22.9658 22.0991 23.131Z" fill="#455A64"/>
</svg>

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 630 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 86 KiB

+2499
View File
File diff suppressed because it is too large Load Diff
+176
View File
@@ -0,0 +1,176 @@
#!/usr/bin/env node
const REPO = 't8y2/dbx';
const GITHUB_TOKEN = process.env.GITHUB_TOKEN || '';
const DEEPSEEK_API_KEY = process.env.DEEPSEEK_API_KEY || '';
const OUT_CN = 'releases-cn.json';
const OUT_EN = 'releases-en.json';
const SECTION_MAP = {
'新功能': 'added',
'Added': 'added',
'改进': 'improved',
'Improved': 'improved',
'修复': 'fixed',
'Fixed': 'fixed',
'变更': 'changed',
'Changed': 'changed',
'移除': 'removed',
'Removed': 'removed',
};
async function fetchAllReleases() {
const releases = [];
let page = 1;
while (true) {
const res = await fetch(
`https://api.github.com/repos/${REPO}/releases?per_page=100&page=${page}`,
{ headers: { Authorization: `token ${GITHUB_TOKEN}`, Accept: 'application/vnd.github+json' } },
);
if (!res.ok) throw new Error(`GitHub API ${res.status}: ${await res.text()}`);
const data = await res.json();
if (data.length === 0) break;
releases.push(...data);
page++;
}
return releases;
}
function stripDownloadSection(body) {
const markers = ['### 下载安装', '### Download', '### 系统要求', '### System Requirements'];
let idx = body.length;
for (const m of markers) {
const i = body.indexOf(m);
if (i !== -1 && i < idx) idx = i;
}
return body.slice(0, idx).trim();
}
function parseBody(body) {
const cleaned = stripDownloadSection(body);
const sections = [];
let current = null;
for (const line of cleaned.split('\n')) {
const headerMatch = line.match(/^###\s+(.+)/);
if (headerMatch) {
const title = headerMatch[1].trim();
const type = SECTION_MAP[title] || 'other';
current = { type, title, items: [] };
sections.push(current);
continue;
}
if (!current) continue;
const itemMatch = line.match(/^-\s+\*\*(.+?)\*\*\s*[—–-]\s*(.+)/);
if (itemMatch) {
current.items.push({ title: itemMatch[1].trim(), desc: itemMatch[2].trim() });
continue;
}
const plainMatch = line.match(/^-\s+(.+)/);
if (plainMatch) {
current.items.push({ title: plainMatch[1].trim(), desc: '' });
}
}
return sections.filter((s) => s.items.length > 0);
}
function buildReleasesJson(releases) {
return {
updatedAt: new Date().toISOString(),
releases: releases
.filter((r) => !r.draft && !r.prerelease)
.sort((a, b) => new Date(b.published_at) - new Date(a.published_at))
.map((r) => ({
tag: r.tag_name,
name: r.name || r.tag_name,
date: r.published_at.slice(0, 10),
sections: parseBody(r.body || ''),
})),
};
}
async function translateToEnglish(cnJson) {
if (!DEEPSEEK_API_KEY) {
console.warn('DEEPSEEK_API_KEY not set, skipping translation');
return null;
}
const enReleases = [];
for (const release of cnJson.releases) {
const sectionsText = release.sections
.map((s) => {
const items = s.items.map((i) => (i.desc ? `- **${i.title}** — ${i.desc}` : `- ${i.title}`)).join('\n');
return `### ${s.title}\n${items}`;
})
.join('\n\n');
if (!sectionsText.trim()) {
enReleases.push({ ...release, sections: [] });
continue;
}
const res = await fetch('https://api.deepseek.com/chat/completions', {
method: 'POST',
headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${DEEPSEEK_API_KEY}` },
body: JSON.stringify({
model: 'deepseek-chat',
messages: [
{
role: 'system',
content:
'You are a technical translator. Translate the following Chinese software changelog to English. Keep the exact markdown format (### headers, - bullet points, **bold** titles, — dashes). Only translate, do not add or remove content. Keep technical terms, product names, and contributor names unchanged.',
},
{ role: 'user', content: sectionsText },
],
temperature: 0.1,
}),
});
if (!res.ok) {
console.error(`DeepSeek API error for ${release.tag}: ${res.status}`);
enReleases.push(release);
continue;
}
const data = await res.json();
const translated = data.choices?.[0]?.message?.content || '';
const enSections = parseBody(translated);
enReleases.push({ ...release, sections: enSections.length > 0 ? enSections : release.sections });
await new Promise((r) => setTimeout(r, 200));
}
return { updatedAt: cnJson.updatedAt, releases: enReleases };
}
async function main() {
console.log('Fetching releases from GitHub...');
const releases = await fetchAllReleases();
console.log(`Found ${releases.length} releases`);
const cnJson = buildReleasesJson(releases);
console.log(`Processed ${cnJson.releases.length} non-draft releases`);
const { writeFileSync } = await import('node:fs');
writeFileSync(OUT_CN, JSON.stringify(cnJson, null, 2));
console.log(`Wrote ${OUT_CN}`);
console.log('Translating to English...');
const enJson = await translateToEnglish(cnJson);
if (enJson) {
writeFileSync(OUT_EN, JSON.stringify(enJson, null, 2));
console.log(`Wrote ${OUT_EN}`);
}
console.log('Done!');
}
main().catch((err) => {
console.error(err);
process.exit(1);
});