Browse Source

docs: update

main
Leon 6 months ago
parent
commit
7eb05f173b
4 changed files with 47 additions and 100 deletions
  1. +1
    -1
      docs/guide/tutorial/dataflow.mdx
  2. +13
    -0
      rspress.config.ts
  3. +0
    -25
      theme/cc.tsx
  4. +33
    -74
      theme/index.tsx

+ 1
- 1
docs/guide/tutorial/dataflow.mdx View File

@@ -2,7 +2,7 @@

作者: [李扬](https://echoli.cn)

欢迎来到 `dora` 教程! `dora` 是一个强大的框架,旨在帮助您构建复杂的应用程序,尤其是那些需要处理实时数据的应用程序,例如机器人技术或 `AI` 用。
欢迎来到 `dora` 教程! `dora` 是一个强大的框架,旨在帮助您构建复杂的应用程序,尤其是那些需要处理实时数据的应用程序,例如机器人技术或 `AI` 用。

但是,如何设计和管理这些需要不同组件协同工作并共享信息的应用程序呢?这就是 **`Dataflow 数据流`** 的概念!



+ 13
- 0
rspress.config.ts View File

@@ -17,6 +17,7 @@ export default defineConfig({
// },
head: [
'<meta name="Author" content="李扬">',
// '<script>var _hmt = _hmt || [];(function() {var hm = document.createElement("script");hm.src="https://hm.baidu.com/hm.js?bad2b636058313c698986f4096bb5742";var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(hm, s);})();</script>'
],
themeConfig: {
socialLinks: [
@@ -46,4 +47,16 @@ export default defineConfig({
mediumZoom: {
selector: '.rspress-doc img',
},
builderConfig: {
html: {
tags: [
{
tag: 'script',
attrs: {
src: 'https://hm.baidu.com/hm.js?bad2b636058313c698986f4096bb5742'
}
}
]
}
}
});

+ 0
- 25
theme/cc.tsx View File

@@ -1,25 +0,0 @@
import React from "react";

const CC = () => (
<div style={{ textAlign: "center", marginTop: "40px", paddingTop: "20px", borderTop: "1px solid #ccc" }}>
<p>
<a rel="license" target="_blank" href="https://creativecommons.org/licenses/by-nc-nd/4.0/deed.zh">
<img
alt="知识共享许可协议"
style={{ borderWidth: 0, margin: "0 auto" }}
src="https://i.creativecommons.org/l/by-nc-nd/4.0/88x31.png"
/>
</a>
</p>
<p>
本作品采用
<a rel="license" target="_blank" href="https://creativecommons.org/licenses/by-nc-nd/4.0/deed.zh">
知识共享署名-非商业性使用-禁止演绎 4.0 国际许可协议
</a>
进行许可
</p>
<script src="https://hm.baidu.com/hm.js?bad2b636058313c698986f4096bb5742" />
</div>
);

export default CC;

+ 33
- 74
theme/index.tsx View File

@@ -1,74 +1,33 @@
import Theme from '@rspress/core/theme';

import { useEffect } from 'react';
import './index.css';
import CC from './cc';

import { useLocation } from 'rspress/runtime';

function MyComponent() {
const location = useLocation();
console.log('Current location:', location);
return <div>{location.pathname}</div>;
}

const Layout = () => {
useEffect(() => {
// const data = usePageData();
// console.log('Page Data:', data);
// Baidu Analytics script injection
let hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?bad2b636058313c698986f4096bb5742";
hm.type = "text/javascript";

// let gitcus = document.createElement("script");
// gitcus.src = "https://giscus.app/client.js";
// gitcus.setAttribute("data-repo", "DoraCN/doracc.com");
// gitcus.setAttribute("data-repo-id", "R_kgDOPMxSoA");
// gitcus.setAttribute("data-category", "Announcements");
// gitcus.setAttribute("data-category-id", "DIC_kwDOPMxSoM4CtH7d");
// gitcus.setAttribute("data-mapping", "pathname");
// gitcus.setAttribute("data-strict", "0");
// gitcus.setAttribute("data-reactions-enabled", "1");
// gitcus.setAttribute("data-emit-metadata", "0");
// gitcus.setAttribute("data-input-position", "bottom");
// gitcus.setAttribute("data-theme", "preferred_color_scheme");
// gitcus.setAttribute("data-lang", "zh-CN");
// gitcus.setAttribute("data-loading", "lazy");
// gitcus.crossOrigin = "anonymous";
// gitcus.async = true;

setTimeout(() => {
const root = document.getElementById('root');
if (root) {
root.appendChild(hm);
// root.appendChild(gitcus);
}
}, 0);


}, []);

return (
<Theme.Layout bottom=
{
<div className='doracc-footer'>
<p><img src="/logo.svg" style={{ width: '30px', display: 'inline' }} /></p>
<p>Dora中文社区 © 2025 <a href="/">doracc.com</a></p>
<p><a href="https://beian.miit.gov.cn/" rel="noreferrer"> 苏ICP备14007268号-19 </a> | <img src="/beian.png" style={{ width: '12px', display: 'inline' }} /><a href="https://beian.mps.gov.cn/#/query/webSearch?code=32050602013520" rel="noreferrer"> 苏公网安备32050602013520号 </a></p>
</div>
}
beforeDocFooter={<CC/>}
// afterDocFooter={<div className='giscus giscus-frame'>qqqqq <MyComponent /> <CC/></div>}
/>
);
};

export default {
...Theme,
Layout,
};

export * from '@rspress/core/theme';
// import Theme from 'rspress/theme';

// // import './index.css';

// const Layout = () => <Theme.Layout
// // bottom={
// // <div className='doracc-footer'>
// // <p><img src="/logo.svg" style={{ width: '30px', display: 'inline' }} /></p>
// // <p>Dora中文社区 © 2025 <a href="/">doracc.com</a></p>
// // <p><a href="https://beian.miit.gov.cn/" rel="noreferrer"> 苏ICP备14007268号-19 </a> | <img src="/beian.png" style={{ width: '12px', display: 'inline' }} /><a href="https://beian.mps.gov.cn/#/query/webSearch?code=32050602013520" rel="noreferrer"> 苏公网安备32050602013520号 </a></p>
// // </div>
// // }
// // beforeDocFooter={
// // <div style={{ textAlign: "center", marginTop: "40px", paddingTop: "20px", borderTop: "1px solid #ccc" }}>
// // <p>
// // <a rel="license" target="_blank" href="https://creativecommons.org/licenses/by-nc-nd/4.0/deed.zh">
// // <img alt="知识共享许可协议" style={{ borderWidth: 0, margin: "0 auto" }} src="https://i.creativecommons.org/l/by-nc-nd/4.0/88x31.png"/>
// // </a>
// // </p>
// // <p>
// // 本作品采用<a rel="license" target="_blank" href="https://creativecommons.org/licenses/by-nc-nd/4.0/deed.zh">知识共享署名-非商业性使用-禁止演绎 4.0 国际许可协议</a>进行许可
// // </p>
// // </div>
// // }
// afterDocFooter={<div className='giscus giscus-frame'>qqqqq</div>}
// />

// export default {
// ...Theme,
// Layout,
// };

// export * from 'rspress/theme';

Loading…
Cancel
Save