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/10/23 02:44:44 UTC
[dubbo-website] 07/12: add 404 redirect
This is an automated email from the ASF dual-hosted git repository.
liujun pushed a commit to branch mkdocs
in repository https://gitbox.apache.org/repos/asf/dubbo-website.git
commit d4b4fa6640a04174eb96fa3aa5384975028e04d0
Author: ken.lj <ke...@gmail.com>
AuthorDate: Thu Oct 22 17:59:02 2020 +0800
add 404 redirect
---
404.html | 15 +++++++++++----
mkdocs_en.yml | 9 ++++-----
2 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/404.html b/404.html
index 0f87552..588d5d0 100644
--- a/404.html
+++ b/404.html
@@ -33,16 +33,23 @@
} 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/2019-2020.html");
+ window.location.href = newHref("blog/index.html", "blog/dubbo-101/");
} else {
- window.location.href = "http://dubbo.apache.org/en-us/";
+ // 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 = originalHref.substring(idx + path.length);
- return part1 + newPath + part2;
+ 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;
}
</script>
</body>
diff --git a/mkdocs_en.yml b/mkdocs_en.yml
index 20ee95e..dbe4ad1 100644
--- a/mkdocs_en.yml
+++ b/mkdocs_en.yml
@@ -156,14 +156,13 @@ nav:
- "Preface":
- "Bakcground": 'docs/3.0/user/preface/background.md'
- "Blog":
- - "2019-2020": 'blog/apache-dubbo-2019-2020.md'
+ - "Your First Dubbo Demo": 'blog/dubbo-101.md'
- "Dubbo Admin service test": 'blog/service-test.md'
- "Implementation background and practice of Dubbo server asynchronous interface": 'blog/dubboAsync_server.md'
- "Implementation background and practice of Dubbo client asynchronous interface": 'blog/dubboAsync_client.md'
- "How to use Fescar to ensure consistency between Dubbo Microservices": 'blog/dubbo-fescar.md'
- "Prepare an Apache Release": 'blog/prepare-an-apache-release.md'
- "Dubbo protocol": 'blog/dubbo-protocol.md'
- - "Your First Dubbo Demo": 'blog/dubbo-101.md'
- "Your First Dubbo filter": 'blog/first-dubbo-filter.md'
- "Using Zookeeper in Dubbo": 'blog/dubbo-zk.md'
- "Using annotation in Dubbo": 'blog/dubbo-annotation.md'
@@ -175,6 +174,8 @@ nav:
- "Sentinel: The flow sentinel of Dubbo service": 'blog/sentinel-introduction-for-dubbo.md'
- "Tracking with Pinpoint": 'blog/pinpoint.md'
- "Developers":
+ - "How to contribute": 'developers/guide_dev.md'
+ - "Developers": 'developers/developers_dev.md'
- "User Guide":
- "faq": 'developers/user-guide/faq_dev.md'
- "Contributor Guide":
@@ -192,10 +193,8 @@ nav:
- "Website Guide": 'developers/committer-guide/website-guide_dev.md'
- "Apache Dubbo Page Maintenance": 'developers/committer-guide/apache-dubbo-page_dev.md'
- "Release Guide": 'developers/committer-guide/release-guide_dev.md'
- - "How to contribute": 'developers/guide_dev.md'
- - "Developers": 'developers/developers_dev.md'
- "Downloads":
- - "Releases": "blog/downloads.md"
+ - "Releases": "blog/download.md"
# Configuration
theme:
name: null