You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by du...@apache.org on 2022/12/13 00:29:38 UTC

[shardingsphere] branch master updated: Add Legacy option for version select (#22836)

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

duanzhengqiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new ce91f9a11c4 Add Legacy option for version select (#22836)
ce91f9a11c4 is described below

commit ce91f9a11c47052bef9e925b65206279a4500828
Author: Junfeng <i...@jacob953.com>
AuthorDate: Tue Dec 13 08:29:22 2022 +0800

    Add Legacy option for version select (#22836)
    
    * fix: replace 'document/[\w|-]*' to 'document/[^/]*'
    
    Signed-off-by: Junfeng <i...@jacob953.com>
    
    * feat: refactor version select
    
    Signed-off-by: Junfeng <i...@jacob953.com>
    
    Signed-off-by: Junfeng <i...@jacob953.com>
---
 .../hugo-theme-learn/layouts/partials/language.html     | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/docs/document/themes/hugo-theme-learn/layouts/partials/language.html b/docs/document/themes/hugo-theme-learn/layouts/partials/language.html
index d76be7cc73e..de6e3d27a34 100644
--- a/docs/document/themes/hugo-theme-learn/layouts/partials/language.html
+++ b/docs/document/themes/hugo-theme-learn/layouts/partials/language.html
@@ -1,5 +1,11 @@
 {{ $currentNode := . }}
 {{ $permalink := string .Permalink }}
+{{ $v5 := slice "5.3.0" "5.2.1" "5.2.0" "5.1.2" "5.1.1" "5.1.0" "5.0.0"}}
+{{ $v4 := slice "4.1.1" "4.1.0" "4.0.1" "4.0.0"}}
+{{ $v3 := slice "3.1.0" "3.0.0"}}
+{{ $v2 := slice "2.0.3" "2.0.2" "2.0.1" "2.0.0"}}
+{{ $v1 := slice "1.5.4" "1.5.3" "1.5.2" "1.5.1" "1.5.0" "1.4.2" "1.4.1" "1.4.0" "1.3.3" "1.3.2" "1.3.1" "1.3.0" "1.2.1" "1.2.0" "1.1.0" "1.0.1" "1.0.0"}}
+{{ $versions := slice (slice "current") $v5 $v4 $v3 $v2 $v1 }}
         {{ $showvisitedlinks := .Site.Params.showVisitedLinks }}
         {{ if or .Site.IsMultiLingual $showvisitedlinks }}
         <section id="prefooter">
@@ -11,16 +17,13 @@
                 <i class="fa fa-fw fa-tags"></i>
               <div class="select-style">
                 <select id="select-version" onchange="location = this.value;">
-              {{ $versions := slice "current" "5.2.1" "5.2.0" "5.1.2" "5.1.1" "5.1.0" "5.0.0-RC1" "5.0.0-beta" "5.0.0-alpha" "5.0.0" "4.1.1" "4.1.0" "4.0.1" "4.0.0-RC3" "4.0.0-RC2" "4.0.0-RC1" "4.0.0" "3.1.0.M1" "3.1.0" "3.0.0.M4" "3.0.0.M3" "3.0.0.M2" "3.0.0.M1" "3.0.0" "2.0.3" "2.0.2" "2.0.1" "2.0.0.M3" "2.0.0.M2" "2.0.0.M1" "2.0.0" "1.5.4.1" "1.5.4" "1.5.3" "1.5.2" "1.5.1" "1.5.0.M3" "1.5.0.M2" "1.5.0.M1" "1.5.0" "1.4.2" "1.4.1" "1.4.0" "1.3.3" "1.3.2" "1.3.1" "1.3.0" "1.2.1" "1.2.0"  [...]
-              {{ $permalink }}
               {{ range $versions }}
+              {{ range . }}
                 {{ $version := . }}
-                {{ if strings.HasSuffix $permalink $version }}
-                  <option id="{{ $version }}" value="{{ replaceRE "document/[^/]*" (printf "document/%s" $version) $permalink }}" selected>{{ $version }}</option>
-                {{ else }}
-                  <option id="{{ $version }}" value="{{ replaceRE "document/[^/]*" (printf "document/%s" $version) $permalink }}" >{{ $version }}</option>
-                {{ end }}
+                  <option id="{{ $version }}" value="{{ replaceRE "document/[^/]*" (printf "document/%s" $version) $permalink }}" {{ if in $permalink $version }} selected {{end}} >{{ $version }}</option>
               {{ end }}
+              {{ end }}
+                  <option id="legacy" value="https://shardingsphere.apache.org/legacy.html">Legacy</option>
                 </select>
                 <svg t="1645437162166" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2449" width="32" height="32"><path d="M483.072 714.496l30.165333 30.208 415.957334-415.829333a42.837333 42.837333 0 0 0 0-60.288 42.538667 42.538667 0 0 0-60.330667-0.042667l-355.541333 355.413333-355.242667-355.413333a42.496 42.496 0 0 0-60.288 0 42.837333 42.837333 0 0 0-0.085333 60.330667l383.701333 383.872 1.706667 1.749333z" fill="#3D3D3D" p-id="2450"></ [...]
               </div>