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

jeffreyh pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/doris-website.git


The following commit(s) were added to refs/heads/develop by this push:
     new 361ca4d175b Add judgment on test environment (TEST_ENV_URL) (#1404)
361ca4d175b is described below

commit 361ca4d175b0c626c97a1f04169f4a8c134c39ed
Author: yangon <2689991...@qq.com>
AuthorDate: Mon Nov 25 13:23:20 2024 +0800

    Add judgment on test environment (TEST_ENV_URL) (#1404)
    
    Co-authored-by: liyang <liy...@selectdb.com>
---
 config/custom-docusaurus-plugin.js                     |   7 ++-----
 config/ssrTemplate.js                                  |   8 +++++---
 docusaurus.config.js                                   |  16 +++++++++++-----
 src/theme/SearchBar/fetchIndexes.js                    |   3 ++-
 .../lakehouse-architecture-for-doris-and-lakesoul.png  | Bin 0 -> 248102 bytes
 5 files changed, 20 insertions(+), 14 deletions(-)

diff --git a/config/custom-docusaurus-plugin.js 
b/config/custom-docusaurus-plugin.js
index 543a0924e7c..858a587853b 100644
--- a/config/custom-docusaurus-plugin.js
+++ b/config/custom-docusaurus-plugin.js
@@ -1,5 +1,5 @@
 const path = require('path');
-
+const publicPath = process.env.TEST_ENV_URL || 'https://cdnd.selectdb.com';
 module.exports = function (context, options) {
     return {
         name: 'custom-docusaurus-plugin',
@@ -7,10 +7,7 @@ module.exports = function (context, options) {
             return {
                 output: {
                     ...config.output,
-                    publicPath:
-                        context.i18n.currentLocale === 'en'
-                            ? 'https://cdnd.selectdb.com/'
-                            : 'https://cdnd.selectdb.com/zh-CN/',
+                    publicPath: context.i18n.currentLocale === 'en' ? 
`${publicPath}/` : `${publicPath}/zh-CN/`,
                 },
             };
         },
diff --git a/config/ssrTemplate.js b/config/ssrTemplate.js
index 37923ae8cc4..6102842705e 100644
--- a/config/ssrTemplate.js
+++ b/config/ssrTemplate.js
@@ -1,3 +1,5 @@
+const fetchUrl = `'${process.env.TEST_ENV_URL}'` || 
'https://cdnd.selectdb.com';
+
 module.exports = {
     ssrTemplate: `<!DOCTYPE html>
 <html <%~ it.htmlAttributes %>>
@@ -13,10 +15,10 @@ module.exports = {
       <%~ metaAttribute %>
     <% }); %>
     <% it.stylesheets.forEach((stylesheet) => { %>
-      <link rel="stylesheet" href="<%= 'https://cdnd.selectdb.com' %><%= 
it.baseUrl %><%= stylesheet %>" />
+      <link rel="stylesheet" href="<%= ${fetchUrl} %><%= it.baseUrl %><%= 
stylesheet %>" />
     <% }); %>
     <% it.scripts.forEach((script) => { %>
-      <link rel="preload" href="<%= 'https://cdnd.selectdb.com' %><%= 
it.baseUrl %><%= script %>" as="script">
+      <link rel="preload" href="<%= ${fetchUrl} %><%= it.baseUrl %><%= script 
%>" as="script">
     <% }); %>
   </head>
   <body <%~ it.bodyAttributes %>>
@@ -25,7 +27,7 @@ module.exports = {
       <%~ it.appHtml %>
     </div>
     <% it.scripts.forEach((script) => { %>
-      <script src="<%= 'https://cdnd.selectdb.com' %><%= it.baseUrl %><%= 
script %>"></script>
+      <script src="<%= ${fetchUrl} %><%= it.baseUrl %><%= script %>"></script>
     <% }); %>
     <%~ it.postBodyTags %>
   </body>
diff --git a/docusaurus.config.js b/docusaurus.config.js
index b42acdf381d..e63900b869b 100644
--- a/docusaurus.config.js
+++ b/docusaurus.config.js
@@ -5,6 +5,10 @@ const versionsPlugin = require('./config/versions-plugin');
 const lightCodeTheme = themes.dracula;
 const VERSIONS = require('./versions.json');
 
+const logoImg = process.env.TEST_ENV_URL
+    ? `${process.env.TEST_ENV_URL}/images/logo.svg`
+    : 'https://cdnd.selectdb.com/images/logo.svg';
+
 function getDocsVersions() {
     const result = {};
     VERSIONS.map(version => {
@@ -241,7 +245,7 @@ const config = {
                 title: '',
                 logo: {
                     alt: 'Apache Doris',
-                    src: 'https://cdnd.selectdb.com/images/logo.svg',
+                    src: logoImg,
                 },
                 items: [
                     // { to: '/', label: 'Home', position: 'left', exact: true 
},
@@ -299,7 +303,7 @@ const config = {
                 title: '',
                 logo: {
                     alt: 'Apache Doris',
-                    src: 'https://cdnd.selectdb.com/images/logo.svg',
+                    src: logoImg,
                 },
                 items: [
                     {
@@ -316,7 +320,8 @@ const config = {
                         // to: 
'/docs/install/source-install/compilation-with-docker',
                         type: 'doc',
                         docId: 
'install/source-install/compilation-with-docker',
-                        activeBaseRegex: 
'summary|install/cluster-deployment|install/source-install|db-connect|table-design|data-operate|query|lakehouse|compute-storage-decoupled|admin-manual|practical-guide|sql-manual',
+                        activeBaseRegex:
+                            
'summary|install/cluster-deployment|install/source-install|db-connect|table-design|data-operate|query|lakehouse|compute-storage-decoupled|admin-manual|practical-guide|sql-manual',
                     },
                     {
                         label: '性能测试',
@@ -362,7 +367,7 @@ const config = {
                 title: '',
                 logo: {
                     alt: 'Apache Doris',
-                    src: 'https://cdnd.selectdb.com/images/logo.svg',
+                    src: logoImg,
                 },
                 items: [
                     {
@@ -379,7 +384,8 @@ const config = {
                         // to: 
'/docs/install/source-install/compilation-with-docker',
                         type: 'doc',
                         docId: 
'install/source-install/compilation-with-docker',
-                        activeBaseRegex: 
'summary|install/cluster-deployment|install/source-install|db-connect|table-design|data-operate|query|lakehouse|compute-storage-decoupled|admin-manual|practical-guide|sql-manual'
+                        activeBaseRegex:
+                            
'summary|install/cluster-deployment|install/source-install|db-connect|table-design|data-operate|query|lakehouse|compute-storage-decoupled|admin-manual|practical-guide|sql-manual',
                     },
                     {
                         label: 'Benchmark',
diff --git a/src/theme/SearchBar/fetchIndexes.js 
b/src/theme/SearchBar/fetchIndexes.js
index 4a9f974043a..aec0ff1117e 100644
--- a/src/theme/SearchBar/fetchIndexes.js
+++ b/src/theme/SearchBar/fetchIndexes.js
@@ -1,9 +1,10 @@
 import lunr from 'lunr';
 import { searchIndexUrl } from '../../utils/proxiedGenerated';
+const host = process.env.TEST_ENV_URL || 'https://cdnd.selectdb.com';
 export async function fetchIndexes(baseUrl) {
     if (process.env.NODE_ENV === 'production') {
         // const json = await (await 
fetch(`${baseUrl}${searchIndexUrl}`)).json();
-        const json = await (await 
fetch(`https://cdnd.selectdb.com${baseUrl}${searchIndexUrl}`)).json();
+        const json = await (await 
fetch(`${host}${baseUrl}${searchIndexUrl}`)).json();
         const wrappedIndexes = json.map(({ documents, index }, type) => ({
             type: type,
             documents,
diff --git a/static/images/lakehouse-architecture-for-doris-and-lakesoul.png 
b/static/images/lakehouse-architecture-for-doris-and-lakesoul.png
new file mode 100644
index 00000000000..000c2f556c8
Binary files /dev/null and 
b/static/images/lakehouse-architecture-for-doris-and-lakesoul.png differ


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to