diff --git a/docusaurus.config.js b/docusaurus.config.js index 391b6bbe7f..ffc25865f6 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -31,6 +31,10 @@ module.exports = { organizationName: 'apache', projectName: 'eventmesh', themeConfig: { + colorMode: { + defaultMode: 'dark', + respectPrefersColorScheme: false, + }, algolia: { appId: 'D5N4C17BGA', apiKey: 'b88c3c5f941724113717b2c8456d0422', @@ -252,4 +256,14 @@ module.exports = { }, ], ], + stylesheets: [ + '/css/docusaurus-override.css', + '/css/site-redesign.css', + ], + scripts: [ + { src: '/js/theme-init.js' }, + { src: '/js/eventmesh-theme.js', defer: true }, + { src: '/js/eventmesh-internal.js', defer: true }, + { src: '/js/site-redesign.js', defer: true }, + ], }; diff --git a/i18n/zh/docusaurus-plugin-content-pages/index.tsx b/i18n/zh/docusaurus-plugin-content-pages/index.tsx new file mode 100644 index 0000000000..5d4f95f556 --- /dev/null +++ b/i18n/zh/docusaurus-plugin-content-pages/index.tsx @@ -0,0 +1,491 @@ +import React from 'react'; +import Head from '@docusaurus/Head'; +import {useEffect} from 'react'; + +const publishCode = `# 通过 HTTP 发布 CloudEvent +curl -X POST \ + http://127.0.0.1:10105/eventmesh/publish/TEST-TOPIC-HTTP-ASYNC \ + -H "Content-Type: application/json" \ + -d '{ + "name": "eventmesh", + "pass": "password" + }' + +# 响应: +{ + "success": true, + "retCode": 0 +} 🚀 事件已发布!`; + +const subscribeCode = `# 通过 HTTP Webhook 订阅主题 +curl -X POST \ + http://127.0.0.1:10105/eventmesh/subscribe/local \ + -H "Content-Type: application/json" \ + -d '{ + "url": "http://127.0.0.1:8088/sub/test", + "consumerGroup": "TEST-GROUP", + "topic": [{"mode":"CLUSTERING","topic":"TEST-TOPIC-HTTP-ASYNC","type":"ASYNC"}] + }' + +# 事件以 CloudEvents 格式推送到你的 Webhook 📨`; + +export default function Home() { + useEffect(() => { + document.body.classList.add('is-homepage'); + return () => document.body.classList.remove('is-homepage'); + }, []); + + return ( +
+ Apache EventMesh 是云原生事件中间件,通过统一事件总线连接服务、系统和 AI Agent。 + 无服务器、可扩展、协议无关 — 为下一代分布式应用而生。 +
+ ++ 从简单的发布/订阅到复杂的事件编排,EventMesh 提供构建弹性、可扩展、 + 解耦分布式系统的全套基础设施。 +
+每秒百万级事件,亚毫秒延迟。支持 RocketMQ、Kafka、AutoMQ 等可插拔事件存储引擎。
+CNCF CloudEvents 规范一等公民支持。跨所有连接器和协议的标准化事件格式。
+HTTP、gRPC、TCP、WebSocket 协议统一到一个事件网格。无需改码即可协议转换。
+基于 Serverless Workflow 的内置事件工作流引擎。用声明式 YAML 定义复杂事件编排。
+支持至少一次、最多一次、精确一次投递语义。事件存储内置重试、死信队列和事务支持。
+内置 mTLS、OAuth2 和 RBAC。事件 Schema 注册中心、审计日志和限流,满足生产级安全需求。
++ 四层解耦架构 — 每层可独立扩展和替换。 + 自由组合连接器、协议和事件存储,适配你的基础设施。 +
++ EventMesh 正在从传统事件中间件演进为 AI Agent 间通信的统一消息总线, + 基于 A2A(Agent-to-Agent)协议构建。 +
+ ++ 开箱即用的连接器。EventMesh 与你现有的基础设施无缝集成 — + 无需推倒重来。 +
++ 用 Docker 部署 EventMesh,发布你的第一个事件并订阅 — + 只需几行代码。无需复杂配置。 +
++ Apache EventMesh 是 Apache 软件基金会顶级项目。 + 加入 300+ 贡献者,共建事件驱动基础设施的未来。 +
+ ++ body_close = content.rfind('') + if body_close > 0: + content = content[:body_close] + js_inject + '\n' + content[body_close:] + modified = True + + # 3. Inject anti-logo-flash inline style right after
— absolute first CSS rule. + # This prevents the old Docusaurus logo.png from flashing during SPA navigation, + # before any external stylesheet is parsed. The html prefix + !important give max specificity. + ANTI_FLASH_STYLE = '' + anti_flash_present = 'data-em-anti-flash' in content + if not anti_flash_present: + head_close = content.find('
') + if head_close > 0: + insert_pos = head_close + len('
') + content = content[:insert_pos] + '\n' + ANTI_FLASH_STYLE + content[insert_pos:] + modified = True + + # 4. Ensure theme init script is before any Docusaurus scripts in
+ # Check if already has our theme init + theme_init_present = 'localStorage.getItem("eventmesh-theme")' in content + if not theme_init_present: + # Find the Docusaurus theme script that sets dark: + docusaurus_theme = 'data-theme","dark");h.classList.add("dark")' + if docusaurus_theme in content: + # Insert our theme init BEFORE the Docusaurus one + idx = content.find(docusaurus_theme) + # Find the start of this script tag + script_start = content.rfind('