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

kirs 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 d59470f  Fix page flash problem in documentation (#337)
d59470f is described below

commit d59470f8d4849077f3f30cfde907526b39d04634
Author: Shiwen Cheng <[email protected]>
AuthorDate: Wed Apr 28 18:54:19 2021 +0800

    Fix page flash problem in documentation (#337)
---
 package.json                | 2 +-
 src/pages/docs/index.md.jsx | 7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/package.json b/package.json
index ef00a05..6a249e3 100644
--- a/package.json
+++ b/package.json
@@ -40,7 +40,7 @@
     "copy-webpack-plugin": "^4.6.0",
     "css-loader": "0.28.11",
     "css-modules-require-hook": "^4.2.3",
-    "docsite-ext": "^1.5.1",
+    "docsite-ext": "^1.5.2",
     "eslint": "^5.16.0",
     "eslint-config-ali": "^4.1.1",
     "eslint-plugin-import": "*",
diff --git a/src/pages/docs/index.md.jsx b/src/pages/docs/index.md.jsx
index f1fced3..b656b4c 100644
--- a/src/pages/docs/index.md.jsx
+++ b/src/pages/docs/index.md.jsx
@@ -33,10 +33,15 @@ class Docs extends Md2Html(Language) {
   render() {
     const language = this.getLanguage();
     let dataSource = {};
+    // from location path
     let version = window.location.pathname.split('/')[3];
-    if ((isValidVersion(version) || version === 'latest')) {
+    if (isValidVersion(version) || version === 'latest') {
       cookie.set('docs_version', version);
     }
+    // from rendering html
+    if (!version && this.props.subdir) {
+      version = this.props.subdir.split('/')[0]
+    }
     if (isValidVersion(version)) {
       dataSource = docsSource[version][language];
     } else if (isValidVersion(cookie.get('docs_version'))) {

Reply via email to