You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by li...@apache.org on 2020/11/02 02:39:04 UTC

[dubbo-website] branch master updated: update 404 page

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 3b194a8  update 404 page
3b194a8 is described below

commit 3b194a88bc18341818bf7dc4c2896a36519a1878
Author: ken.lj <ke...@gmail.com>
AuthorDate: Mon Nov 2 10:35:22 2020 +0800

    update 404 page
---
 material/404.html | 51 ++++++++++++++++++++++++++++++++++++++-------------
 1 file changed, 38 insertions(+), 13 deletions(-)

diff --git a/material/404.html b/material/404.html
index da2844e..d4f3c8d 100755
--- a/material/404.html
+++ b/material/404.html
@@ -1,12 +1,13 @@
-{#-
-  This file was automatically generated - do not edit
--#}
-{% extends "base.html" %}
-{% block content %}
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="UTF-8">
+</head>
+<body>
 <!-- 添加Apache校验项开始 -->
 <!-- 只加a标签和img标签,不要有其余的标签出现,同时设置style="display: none" -->
 <a style="display: none" href="http://www.apache.org/events/current-event">Apache Dubbo is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the comple [...]
-<img style="display: none" src="http://dubbo.apache.org/en-us/img/apache_logo.png"/>
+<img style="display: none" src="http://dubbo.apache.org/img/apache_logo.png"/>
 <ul style="display: none">
   <p class="header">ASF</p>
   <li><a href="http://www.apache.org">Foundation</a></li>
@@ -20,12 +21,36 @@
 <!-- 添加Apache校验项结束 -->
 <script src="//cdn.jsdelivr.net/npm/js-cookie@2/src/js.cookie.min.js"></script>
 <script>
-  window.rootPath = '';
-  window.defaultLanguage = 'en-us';
-  var lang = Cookies.get('docsite_language');
-  if (!lang) {
-    lang = 'en-us';
+  var originalHref = window.location.href;
+  if (originalHref.indexOf("docs/user/") > -1) {
+    window.location.href = newHref("docs/user/", "docs/2.7/user/");
+  } else if (originalHref.indexOf("docs/dev/") > -1) {
+    window.location.href = newHref("docs/dev/", "docs/2.7/dev/");
+  } else if (originalHref.indexOf("docs/admin/") > -1) {
+    window.location.href = newHref("docs/admin/", "docs/2.7/admin/");
+  } else if (originalHref.indexOf("docs/source_code_guide/") > -1) {
+    window.location.href = newHref("docs/source_code_guide/", "docs/2.7/source_code_guide/");
+  } else if (originalHref.indexOf("docs/developers/") > -1) {
+    window.location.href = newHref("docs/developers/", "developers/");
+  } else if (originalHref.indexOf("blog/index.html") >-1) {
+    window.location.href = newHref("blog/index.html", "blog/dubbo-101/");
+  } else {
+    // window.location.href = "http://dubbo.apache.org/en-us/";
+  }
+
+  function newHref(path, newPath) {
+    var idx = originalHref.indexOf(path);
+    var part1 = originalHref.substring(0, idx);
+    var part2 = "";
+    if (idx + path.length < originalHref.length -1) {
+      part2 = originalHref.substring(idx + path.length);
+    }
+    var newHref = part1 + newPath + part2;
+    if (newHref.endsWith('.html')) {
+      newHref = newHref.substr(0, newHref.length - 5) + "/";
+    }
+    return newHref;
   }
-  window.location = window.rootPath + '/' + lang;
 </script>
-{% endblock %}
+</body>
+</html>
\ No newline at end of file