You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by wa...@apache.org on 2023/02/06 10:21:03 UTC

[dolphinscheduler-website] branch master updated: [Enhancement] Some improvements. (#881)

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

wanggenhua pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler-website.git


The following commit(s) were added to refs/heads/master by this push:
     new 899aeecfc1 [Enhancement] Some improvements. (#881)
899aeecfc1 is described below

commit 899aeecfc1a32cab4356a425cee33012e4ea782c
Author: Amy0104 <wa...@apache.org>
AuthorDate: Mon Feb 6 18:20:56 2023 +0800

    [Enhancement] Some improvements. (#881)
    
      * Add descriptions
      * Add contribution to the document menu
      * Set the main content width to 1280
---
 config/contribution_menu.js  | 72 ++++++++++++++++++++++++++++++++++++++++++++
 public/index.html            |  6 +++-
 public/locales/en-us.json    | 17 ++++++++---
 public/locales/zh-cn.json    | 17 ++++++++---
 scripts/generate_docs.js     | 54 ++++++++++++++++++++++++++-------
 src/styles/mixin.scss        |  6 ++--
 src/views/Blog/detail.scss   |  6 ++++
 src/views/Blog/index.scss    |  2 +-
 src/views/Home/index.scss    |  2 +-
 src/views/Layout/useTitle.js | 55 +++++++++++++++++----------------
 10 files changed, 186 insertions(+), 51 deletions(-)

diff --git a/config/contribution_menu.js b/config/contribution_menu.js
new file mode 100644
index 0000000000..bd70fa490e
--- /dev/null
+++ b/config/contribution_menu.js
@@ -0,0 +1,72 @@
+module.exports = (lang) => {
+  return {
+    "en-us": {
+      title: "Contribution",
+      children: [
+        {
+          title: "SPI",
+          children: [
+            {
+              title: "Alert SPI",
+              link: `/en-us/docs/${lang}/user_doc/contribute/backend/spi/alert.html`,
+            },
+            {
+              title: "Datasource SPI",
+              link: `/en-us/docs/${lang}/user_doc/contribute/backend/spi/datasource.html`,
+            },
+            {
+              title: "Registry SPI",
+              link: `/en-us/docs/${lang}/user_doc/contribute/backend/spi/registry.html`,
+            },
+            {
+              title: "Task SPI",
+              link: `/en-us/docs/${lang}/user_doc/contribute/backend/spi/task.html`,
+            },
+          ],
+        },
+        {
+          title: "Development Environment Setup",
+          link: `/en-us/docs/${lang}/user_doc/contribute/development-environment-setup.html`,
+        },
+        {
+          title: "Frontend Development",
+          link: `/en-us/docs/${lang}/user_doc/contribute/frontend-development.html`,
+        },
+      ],
+    },
+    "zh-cn": {
+      title: "贡献指南",
+      children: [
+        {
+          title: "SPI",
+          children: [
+            {
+              title: "Alert SPI",
+              link: `/zh-cn/docs/${lang}/user_doc/contribute/backend/spi/alert.html`,
+            },
+            {
+              title: "Datasource SPI",
+              link: `/zh-cn/docs/${lang}/user_doc/contribute/backend/spi/datasource.html`,
+            },
+            {
+              title: "Registry SPI",
+              link: `/zh-cn/docs/${lang}/user_doc/contribute/backend/spi/registry.html`,
+            },
+            {
+              title: "Task SPI",
+              link: `/zh-cn/docs/${lang}/user_doc/contribute/backend/spi/task.html`,
+            },
+          ],
+        },
+        {
+          title: "环境搭建",
+          link: `/zh-cn/docs/${lang}/user_doc/contribute/development-environment-setup.html`,
+        },
+        {
+          title: "前端开发",
+          link: `/zh-cn/docs/${lang}/user_doc/contribute/frontend-development.html`,
+        },
+      ],
+    },
+  };
+};
diff --git a/public/index.html b/public/index.html
index 7ca66eddf3..ae0ab8454d 100644
--- a/public/index.html
+++ b/public/index.html
@@ -7,7 +7,11 @@
     <meta name="theme-color" content="#000000" />
     <meta
       name="description"
-      content="Apache DolphinScheduler is a distributed and easy-to-extend visual workflow scheduler system, dedicated to solving the complex task dependencies in data processing, making the scheduling system out of the box for data processing."
+      content="Apache DolphinScheduler is a distributed and extensible open-source workflow orchestration platform with powerful DAG visual interfaces."
+    />
+    <meta
+      name="keywords"
+      content="apache dolphinscheduler,dolphinscheduler,document,community,workflow scheduler,data orchestration,workflow orchestration,drag and drop workflow,DAG"
     />
     <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
     <!--
diff --git a/public/locales/en-us.json b/public/locales/en-us.json
index 2f4241917f..134fab45c1 100644
--- a/public/locales/en-us.json
+++ b/public/locales/en-us.json
@@ -156,11 +156,20 @@
   "binary_download": "Binary download",
   "join_our_slack": "Join our Slack",
   "contact_emails": " Contact Emails",
-  "documentation_title": "DophinScheduler | DolphinsScheduler Documentation",
+  "docs_title": "DophinScheduler | DolphinsScheduler Documentation",
   "community_title": "DophinScheduler | DolphinScheduler Community",
-  "event_title": "DophinScheduler | DolphinScheduler Event",
+  "events_title": "DophinScheduler | DolphinScheduler Event",
   "blog_title": "DophinScheduler | DolphinScheduler Blog",
-  "cases_title": "DophinScheduler | DolphinScheduler Use Cases",
+  "use_case_title": "DophinScheduler | DolphinScheduler Use Cases",
   "support_title": "DophinScheduler | DolphinScheduler Support",
-  "download_title": "DophinScheduler | DolphinScheduler Download"
+  "download_title": "DophinScheduler | DolphinScheduler Download",
+  "description": "Apache DolphinScheduler is a distributed and extensible open-source workflow orchestration platform with powerful DAG visual interfaces.",
+  "keywords_default": "apache dolphinscheduler,dolphinscheduler,document,community,workflow scheduler,data orchestration,workflow orchestration,drag and drop workflow,DAG",
+  "keywords_docs": "dolphinscheduler document,dolphinscheduler documentation",
+  "keywords_community": "dolphinscheduler community,github,slack,twitter,subscribe,contribute,contributor,committer,guides",
+  "keywords_events": "dolphinscheduler events",
+  "keywords_blog": "dolphinscheduler blog,blog,release note,tech sharing,community trends,tutorial,use cases,events",
+  "keywords_support": "dolphinscheduler support,support,issue,faqs",
+  "keywords_use_case": "dolphinscheduler use case,user",
+  "keywords_download": "dolphinscheduler download,standalone,pseudo cluster,cluster,Kubernetes,cloud"
 }
diff --git a/public/locales/zh-cn.json b/public/locales/zh-cn.json
index 2ff6f0cbfe..b4382a5dba 100644
--- a/public/locales/zh-cn.json
+++ b/public/locales/zh-cn.json
@@ -155,11 +155,20 @@
   "binary_download": "二进制包下载",
   "join_our_slack": "加入Slack",
   "contact_emails": "发送邮件",
-  "documentation_title": "DophinScheduler | 文档中心",
+  "docs_title": "DophinScheduler | 文档中心",
   "community_title": "DophinScheduler | 加入社区",
-  "event_title": "DophinScheduler | 社区活动",
+  "events_title": "DophinScheduler | 社区活动",
   "blog_title": "DophinScheduler | 技术博客",
-  "cases_title": "DophinScheduler | 用户案例",
+  "use_case_title": "DophinScheduler | 用户案例",
   "support_title": "DophinScheduler | 帮助支持",
-  "download_title": "DophinScheduler | 下载"
+  "download_title": "DophinScheduler | 下载",
+  "description": "Apache DolphinScheduler是一个分布式和可扩展的开源工作流协调平台,具有强大的DAG可视化界面",
+  "keywords_default": "海豚调度,apache dolphinscheduler,dolphinscheduler,文档,社区,工作流调度,数据编排,工作流编排,拖拉拽工作流,DAG",
+  "keywords_docs": "dolphinscheduler document,dolphinscheduler documentation,文档",
+  "keywords_community": "dolphinscheduler 社区,github, slack, twitter,订阅,贡献,贡献者,committer,指南",
+  "keywords_events": "dolphinscheduler 社区活动",
+  "keywords_blog": "海豚调度博客,博客,版本发布,技术详解,社区动态,教程,用户案例,海内外活动",
+  "keywords_support": "dolphinscheduler 帮助,support,问题,常见问题",
+  "keywords_use_case": "dolphinscheduler 用户案例,用户",
+  "keywords_download": "dolphinscheduler 下载,单机部署,伪集群部署,集群部署,k8s,云部署"
 }
diff --git a/scripts/generate_docs.js b/scripts/generate_docs.js
index a3b8909c98..6a11bed929 100644
--- a/scripts/generate_docs.js
+++ b/scripts/generate_docs.js
@@ -79,15 +79,7 @@ const addAnchors = (html) => {
 
 const getMenu = (list, data, version, lang, isDeployment, location) => {
   list.forEach((item) => {
-    if (
-      [
-        "FAQ",
-        "Older Versions",
-        "Contribution",
-        "历史版本",
-        "贡献指南",
-      ].includes(item.title)
-    ) {
+    if (["FAQ", "Older Versions", "历史版本"].includes(item.title)) {
       return;
     }
     const temp = {
@@ -237,6 +229,24 @@ const wirteSearchDocData = () => {
 const parseDocsMenu = () => {
   const sourcePath = BASE + "/config/docs";
   const docs = fs.readdirSync(sourcePath);
+  const excludeContributionVersions = [
+    "1.2.0",
+    "1.2.1",
+    "1.3.1",
+    "1.3.2",
+    "1.3.3",
+    "1.3.4",
+    "1.3.5",
+    "1.3.6",
+    "1.3.8",
+    "1.3.9",
+    "2.0.0",
+    "2.0.1",
+    "2.0.2",
+    "2.0.3",
+    "2.0.5",
+    "2.0.6",
+  ];
   docs.forEach((doc) => {
     const filePath = path.join(sourcePath, doc);
     const fileInfo = path.parse(filePath);
@@ -247,8 +257,30 @@ const parseDocsMenu = () => {
 
     const version = getVersion(fileInfo.name);
 
-    getMenu(fileContent["en-us"].sidemenu, enUs, version, "en-us", false);
-    getMenu(fileContent["zh-cn"].sidemenu, zhCn, version, "zh-cn", false);
+    const enMenu = fileContent["en-us"].sidemenu;
+    const zhMenu = fileContent["zh-cn"].sidemenu;
+
+    if (!excludeContributionVersions.includes(version)) {
+      const contributionMenuFn = require(`${BASE}/config/contribution_menu.js`);
+      if (contributionMenuFn && typeof contributionMenuFn === "function") {
+        const contributionMenu = contributionMenuFn(version);
+        enMenu.some((item, index) => {
+          return (
+            item.title === "Contribution" &&
+            (enMenu[index] = contributionMenu["en-us"])
+          );
+        });
+        zhMenu.some((item, index) => {
+          return (
+            item.title === "贡献指南" &&
+            (zhMenu[index] = contributionMenu["zh-cn"])
+          );
+        });
+      }
+    }
+
+    getMenu(enMenu, enUs, version, "en-us", false);
+    getMenu(zhMenu, zhCn, version, "zh-cn", false);
 
     versionData.push(version);
 
diff --git a/src/styles/mixin.scss b/src/styles/mixin.scss
index b60adee709..35d2b60c55 100644
--- a/src/styles/mixin.scss
+++ b/src/styles/mixin.scss
@@ -11,10 +11,10 @@
 }
 
 @mixin content-width {
-  @media screen and (min-width: 1440px) {
-    width: 1440px;
+  @media screen and (min-width: 1280px) {
+    width: 1280px;
   }
-  @media screen and (max-width: 1440px) {
+  @media screen and (max-width: 1280px) {
     width: 100%;
     padding: 0px 2vw;
     box-sizing: border-box;
diff --git a/src/views/Blog/detail.scss b/src/views/Blog/detail.scss
index 5f626c758f..2939157929 100644
--- a/src/views/Blog/detail.scss
+++ b/src/views/Blog/detail.scss
@@ -56,5 +56,11 @@
     img {
       max-width: 100%;
     }
+    pre {
+      font-size: 14px;
+      background-color: rgba(0, 0, 0, 0.1);
+      padding: 10px;
+      border-radius: 10px;
+    }
   }
 }
diff --git a/src/views/Blog/index.scss b/src/views/Blog/index.scss
index b59cc48da4..fd3c6811df 100644
--- a/src/views/Blog/index.scss
+++ b/src/views/Blog/index.scss
@@ -113,7 +113,7 @@
     flex-wrap: wrap;
   }
   &-item {
-    width: 566px;
+    width: 510px;
     height: 339px;
     border: 1px solid rgba(112, 112, 112, 0.6);
     border-radius: 15px;
diff --git a/src/views/Home/index.scss b/src/views/Home/index.scss
index a7ad9555b2..014f129e1a 100644
--- a/src/views/Home/index.scss
+++ b/src/views/Home/index.scss
@@ -52,7 +52,7 @@
     .ant-carousel {
       width: 690px;
 
-      @media screen and (max-width: 1440px) {
+      @media screen and (max-width: 1280px) {
         display: none;
       }
     }
diff --git a/src/views/Layout/useTitle.js b/src/views/Layout/useTitle.js
index f2e1fac2aa..946cc58f82 100644
--- a/src/views/Layout/useTitle.js
+++ b/src/views/Layout/useTitle.js
@@ -7,33 +7,36 @@ export function useTitle() {
   const { t } = useTranslation();
 
   useEffect(() => {
-    if (location.pathname.includes("docs")) {
-      document.title = t("documentation_title");
-      return;
-    }
-    if (location.pathname.includes("community")) {
-      document.title = t("community_title");
-      return;
-    }
-    if (location.pathname.includes("events")) {
-      document.title = t("event_title");
-      return;
-    }
-    if (location.pathname.includes("blog")) {
-      document.title = t("blog_title");
-      return;
-    }
-    if (location.pathname.includes("use_case")) {
-      document.title = t("cases_title");
-      return;
-    }
-    if (location.pathname.includes("support")) {
-      document.title = t("support_title");
-      return;
+    const pages = [
+      "docs",
+      "community",
+      "events",
+      "blog",
+      "use_case",
+      "support",
+      "download",
+    ];
+
+    let title = "Apache DolphinScheduler";
+    let keywords = "";
+
+    pages.some((item) => {
+      if (location.pathname.includes(item)) {
+        title = t(`${item}_title`);
+        keywords = t(`keywords_${item}`);
+        return true;
+      }
+      return false;
+    });
+
+    document.title = title;
+    const descriptionElement = document.querySelector(`meta[name=description]`);
+    const keywordsElement = document.querySelector(`meta[name=keywords]`);
+    if (keywordsElement) {
+      keywordsElement.setAttribute("content", t(keywords));
     }
-    if (location.pathname.includes("download")) {
-      document.title = t("download_title");
-      return;
+    if (descriptionElement) {
+      descriptionElement.setAttribute("content", t("description"));
     }
   }, [location, t]);
 }