This is an automated email from the ASF dual-hosted git repository.

haonan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iotdb-docs.git

commit 2cd10b0f6940b54b6a27597a5e58e474c8349e92
Author: CritasWang <[email protected]>
AuthorDate: Wed Jul 12 15:24:14 2023 +0800

    feat(site):
    1. fix style
    2. fix edit link
---
 src/.vuepress/client.ts              |  2 +-
 src/.vuepress/components/IoTDB.vue   | 12 ++++++------
 src/.vuepress/components/IoTDBZH.vue | 12 ++++++------
 src/.vuepress/config.ts              |  8 ++++----
 src/.vuepress/styles/index.scss      |  7 +++++--
 src/.vuepress/theme.ts               |  8 +++++---
 src/.vuepress/utils/editLink.ts      | 27 ++-------------------------
 7 files changed, 29 insertions(+), 47 deletions(-)

diff --git a/src/.vuepress/client.ts b/src/.vuepress/client.ts
index f09d81b..13c2808 100644
--- a/src/.vuepress/client.ts
+++ b/src/.vuepress/client.ts
@@ -31,4 +31,4 @@ export default defineClientConfig({
     app.component('Contributor', Contributor);
     app.component('IoTDBZH', IoTDBZH);
   },
-});
\ No newline at end of file
+});
diff --git a/src/.vuepress/components/IoTDB.vue 
b/src/.vuepress/components/IoTDB.vue
index c2bb882..d6e1fd1 100644
--- a/src/.vuepress/components/IoTDB.vue
+++ b/src/.vuepress/components/IoTDB.vue
@@ -69,7 +69,7 @@
             content="Apache IoTDB can support high-speed write access for 
millions of low-power and intelligently networked devices. It also provides 
lightning read access for retrieving data."
           >
             <template #reference>
-              <div class="feature-item">
+              <div class="vp-feature-item feature-item">
                 <img src="/img/home-icon1.png" alt="" 
style="width:40px;height:40px;">
                 <p>High-throughput read and write</p>
               </div>
@@ -85,7 +85,7 @@
             content="Apache IoTDB can efficiently organize complex data 
structure from IoT devices and large size of timeseries data with fuzzy 
searching strategy for complex directory of timeseries data."
           >
             <template #reference>
-              <div class="feature-item">
+              <div class="vp-feature-item feature-item">
                 <img src="/img/home-icon2.png" alt="" 
style="width:40px;height:40px;">
                 <p> Efficient directory structure</p></div>
             </template>
@@ -100,7 +100,7 @@
             content="Apache IoTDB can support time alignment for timeseries 
data across devices and sensors, computation in timeseries field and abundant 
aggregation functions in time dimension."
           >
             <template #reference>
-              <div class="feature-item">
+              <div class="vp-feature-item feature-item">
                 <img src="/img/home-icon3.png" alt="" 
style="width:40px;height:40px;">
                 <p>Rich query semantics</p></div>
             </template>
@@ -115,7 +115,7 @@
             content="Apache IoTDB can reach a high compression ratio of disk 
storage (it costs less than $0.23 to store 1GB of data on hard disk)."
           >
             <template #reference>
-              <div class="feature-item">
+              <div class="vp-feature-item feature-item">
                 <img src="/img/home-icon4.png" alt="" 
style="width:40px;height:40px;">
                 <p>Low cost on hardware</p></div>
             </template>
@@ -130,7 +130,7 @@
             content="Apache IoTDB can provide users one-click installation on 
the cloud, terminal tool on desktop and the bridge tool between cloud platform 
and on premise machine (Data Synchronization Tool)."
           >
             <template #reference>
-              <div class="feature-item">
+              <div class="vp-feature-item feature-item">
                 <img src="/img/home-icon5.png" alt="" 
style="width:40px;height:40px;">
                 <p>Flexible deployment</p></div>
             </template>
@@ -145,7 +145,7 @@
             content="Apache IoTDB can support analysis ecosystems, for 
example, Hadoop, Spark, Flink and Grafana (visualization tool)."
           >
             <template #reference>
-              <div class="feature-item">
+              <div class="vp-feature-item feature-item">
                 <img src="/img/home-icon6.png" alt="" 
style="width:40px;height:40px;">
                 <p>Intense integration with Open Source Ecosystem</p></div>
             </template>
diff --git a/src/.vuepress/components/IoTDBZH.vue 
b/src/.vuepress/components/IoTDBZH.vue
index 709c9c3..95b1360 100644
--- a/src/.vuepress/components/IoTDBZH.vue
+++ b/src/.vuepress/components/IoTDBZH.vue
@@ -66,7 +66,7 @@
             content="Apache IoTDB中可以支持数百万个低功耗和智能联网设备的高速写访问。 它还提供数据快速读取访问以查询。"
           >
             <template #reference>
-              <div class="feature-item">
+              <div class="vp-feature-item feature-item">
                 <img src="/img/home-icon1.png" alt="" 
style="width:40px;height:40px;">
                 <p>高吞吐量读写</p>
               </div>
@@ -82,7 +82,7 @@
             content="Apache IoTDB可以对拥有复杂组织关系的物联网设备进行树形结构管理,并使用通配符对这些元数据进行模糊匹配。"
           >
             <template #reference>
-              <div class="feature-item">
+              <div class="vp-feature-item feature-item">
                 <img src="/img/home-icon2.png" alt="" 
style="width:40px;height:40px;">
                 <p> 高效的树形元数据结构</p></div>
             </template>
@@ -98,7 +98,7 @@
             content="Apache IoTDB可以支持跨设备和传感器的时间对齐查询,在时间维度上的聚合(降采样)等。"
           >
             <template #reference>
-              <div class="feature-item">
+              <div class="vp-feature-item feature-item">
                 <img src="/img/home-icon3.png" alt="" 
style="width:40px;height:40px;">
                 <p>丰富的查询语义</p></div>
             </template>
@@ -113,7 +113,7 @@
             content="Apache IoTDB可以实现磁盘存储的高压缩率。"
           >
             <template #reference>
-              <div class="feature-item">
+              <div class="vp-feature-item feature-item">
                 <img src="/img/home-icon4.png" alt="" 
style="width:40px;height:40px;">
                 <p>硬件成本低</p></div>
             </template>
@@ -128,7 +128,7 @@
             content="Apache IoTDB可以为用户提供云上的一键式安装、终端访问工具以及边-云之间的协同(数据同步工具)。"
           >
             <template #reference>
-              <div class="feature-item">
+              <div class="vp-feature-item feature-item">
                 <img src="/img/home-icon5.png" alt="" 
style="width:40px;height:40px;">
                 <p>灵活的部署</p></div>
             </template>
@@ -143,7 +143,7 @@
             content="Apache 
IoTDB支持许多大数据软件生态系统,例如Hadoop、Spark、Flink和Grafana(可视化工具)。"
           >
             <template #reference>
-              <div class="feature-item">
+              <div class="vp-feature-item feature-item">
                 <img src="/img/home-icon6.png" alt="" 
style="width:40px;height:40px;">
                 <p>与开源生态系统的紧密集成</p>
               </div>
diff --git a/src/.vuepress/config.ts b/src/.vuepress/config.ts
index 7b8e0d6..4ebd9aa 100644
--- a/src/.vuepress/config.ts
+++ b/src/.vuepress/config.ts
@@ -57,10 +57,10 @@ export default defineUserConfig({
       dirname,
       './components/PageFooter.vue',
     ),
-    '@theme-hope/modules/info/utils/index': path.resolve(
-      dirname,
-      './utils/index',
-    ),
+    // '@theme-hope/modules/info/utils/index': path.resolve(
+    //   dirname,
+    //   './utils/index',
+    // ),
   },
   plugins: [
     docsearchPlugin({
diff --git a/src/.vuepress/styles/index.scss b/src/.vuepress/styles/index.scss
index 53f586a..a21c8ce 100644
--- a/src/.vuepress/styles/index.scss
+++ b/src/.vuepress/styles/index.scss
@@ -18,13 +18,16 @@
  */
 
 // place your custom styles here
-.hero-info-wrapper, .site-name{
+.hero-info-wrapper, .site-name, .vp-hero-info-wrapper, .vp-site-name{
   display: none;
-}
+} 
 .home.project 
 .theme-hope-content {
   max-width: unset;
 }
+.vp-project-home .theme-hope-content {
+  max-width: unset;
+}
 .el-popover.el-popper {
   text-align: start !important;
   word-break: break-word !important;
diff --git a/src/.vuepress/theme.ts b/src/.vuepress/theme.ts
index 7de3bf5..24c7ed6 100644
--- a/src/.vuepress/theme.ts
+++ b/src/.vuepress/theme.ts
@@ -34,9 +34,11 @@ export default hopeTheme({
 
   repoDisplay: true,
 
-  docsDir: 'docs',
+  docsRepo: 'https://github.com/apache/iotdb-docs',
 
-  docsBranch: 'master',
+  docsDir: 'src',
+
+  docsBranch: 'main',
 
   pure: true,
 
@@ -151,4 +153,4 @@ export default hopeTheme({
       vuePlayground: true,
     },
   },
-});
+}, { custom: true });
diff --git a/src/.vuepress/utils/editLink.ts b/src/.vuepress/utils/editLink.ts
index 957dc2b..e249b33 100644
--- a/src/.vuepress/utils/editLink.ts
+++ b/src/.vuepress/utils/editLink.ts
@@ -40,29 +40,6 @@ interface EditLinkOptions {
   editLinkPattern?: string;
 }
 
-const getBranch = (branch = 'master', path = '') => {
-  if (path.indexOf('UserGuide/Master') > -1 || path.indexOf('UserGuide') === 
-1) {
-    return branch;
-  }
-  const branchRex = /UserGuide\/V(\d+\.\d+\.x)/;
-  if (branchRex.test(path)) {
-    const tag = branchRex.exec(path)![1];
-    return `rel/${tag.replace('.x', '')}`;
-  }
-  return branch;
-};
-const getPath = (path: string) => {
-  if (path.indexOf('UserGuide/Master') > -1 || path.indexOf('UserGuide') === 
-1) {
-    return path.replace('UserGuide/Master', 'UserGuide');
-  }
-  const branchRex = /UserGuide\/V(\d+\.\d+\.x)/;
-  if (branchRex.test(path)) {
-    const tag = branchRex.exec(path)![1];
-    return path.replace(`UserGuide/V${tag}`, 'UserGuide');
-  }
-  return path;
-};
-
 export const resolveEditLink = ({
   docsRepo,
   docsBranch,
@@ -86,9 +63,9 @@ export const resolveEditLink = ({
       /:repo/,
       isLinkHttp(docsRepo) ? docsRepo : `https://github.com/${docsRepo}`,
     )
-    .replace(/:branch/, getBranch(docsBranch, filePathRelative))
+    .replace(/:branch/, docsBranch)
     .replace(
       /:path/,
-      
removeLeadingSlash(`${removeEndingSlash(docsDir)}/${getPath(filePathRelative)}`),
+      removeLeadingSlash(`${removeEndingSlash(docsDir)}/${filePathRelative}`),
     );
 };

Reply via email to