From f3acbeae566935cbff8fa5a4b85022bc2dcc72b3 Mon Sep 17 00:00:00 2001 From: Neucrack Date: Wed, 10 Nov 2021 23:32:53 +0800 Subject: [PATCH] optimize multi lanugage and footer --- config/config_en.json | 27 +++------- config/config_zh.json | 25 +++------ docs/Advanced_development/en/config.json | 22 +------- docs/Advanced_development/zh/config.json | 22 +------- docs/FAQ/en/config.json | 22 +------- docs/FAQ/zh/config.json | 22 +------- docs/Product_case/en/config.json | 22 +------- docs/Product_case/zh/config.json | 22 +------- docs/Quecpython_intro/en/config.json | 22 +------- docs/Quecpython_intro/zh/config.json | 22 +------- docs/Quick_start/en/config.json | 22 +------- docs/Quick_start/zh/config.json | 22 +------- docs/sbs/en/config.json | 22 +------- docs/sbs/zh/config.json | 22 +------- pages/index/en/404.md | 5 +- pages/index/en/config.json | 3 +- pages/index/zh/404.md | 7 ++- pages/index/zh/config.json | 3 +- site_config.json | 65 ++++++++++++++++++------ 19 files changed, 86 insertions(+), 313 deletions(-) diff --git a/config/config_en.json b/config/config_en.json index ed438f2..a66f4b9 100644 --- a/config/config_en.json +++ b/config/config_en.json @@ -1,15 +1,16 @@ { "class": "language_en", + "locale": "en", "navbar": { "title": "QuecPython", "logo": { "alt": "teedoc logo", "src": "/static/image/quectel.png" }, - "home_url": "/", + "home_url": "/en/", "items": [ { - "url": "/doc/Quick_start/en/Quick_start.html", + "url": "/doc/Quick_start/en/index.html", "label": "The document overview", "position": "left" }, @@ -62,19 +63,7 @@ "id": "language", "label": "language: ", "position": "right", - "type": "selection", - "items": [ - { - "id": "zh", - "url": "/", - "label": "中文" - }, - { - "id": "en", - "url": "/en/", - "label": "English" - } - ] + "type": "language" } ] }, @@ -84,13 +73,13 @@ "label": "link", "items": [ { - "label": "Build with teedoc", - "url": "https://github.com/neutree/teedoc", + "label": "Site generated by teedoc", + "url": "https://teedoc.neucrack.com", "target": "_blank" }, { - "label": "Copyright © 2021 Neucrack", - "url": "https://neucrack.com", + "label": "Copyright © 2021 Quectel", + "url": "https://www.quectel.com/", "target": "_blank" } ] diff --git a/config/config_zh.json b/config/config_zh.json index f8eb6b6..8ac9858 100644 --- a/config/config_zh.json +++ b/config/config_zh.json @@ -1,5 +1,6 @@ { "class": "language_zh", + "locale": "zh", "navbar": { "title": "QuecPython", "logo": { @@ -9,7 +10,7 @@ "home_url": "/", "items": [ { - "url": "/doc/Quick_start/zh/Quick_start.html", + "url": "/doc/Quick_start/zh/index.html", "label": "文档简介", "position": "left" }, @@ -62,19 +63,7 @@ "id": "language", "label": "Language: ", "position": "right", - "type": "selection", - "items": [ - { - "id": "zh", - "url": "/", - "label": "中文" - }, - { - "id": "en", - "url": "/en/", - "label": "English" - } - ] + "type": "language" } ] }, @@ -84,13 +73,13 @@ "label": "链接", "items": [ { - "label": "使用 teedoc 构建", - "url": "https://github.com/neutree/teedoc", + "label": "网站使用 teedoc 生成", + "url": "https://teedoc.neucrack.com", "target": "_blank" }, { - "label": "Copyright © 2021 Neucrack", - "url": "https://neucrack.com", + "label": "Copyright © 2021 移远通信", + "url": "https://www.quectel.com/", "target": "_blank" } ] diff --git a/docs/Advanced_development/en/config.json b/docs/Advanced_development/en/config.json index ce6a268..2b8b743 100644 --- a/docs/Advanced_development/en/config.json +++ b/docs/Advanced_development/en/config.json @@ -1,24 +1,4 @@ { "import": "config_zh", - "navbar": { - "items": [ - { - "id": "language", - "label": "Language: ", - "position": "right", - "items": [ - { - "id": "zh", - "url": "/doc/Advanced_development/zh/", - "label": "中文" - }, - { - "id": "en", - "url": "/doc/Advanced_development/en/", - "label": "English" - } - ] - } - ] - } + "name": "Advanced development" } \ No newline at end of file diff --git a/docs/Advanced_development/zh/config.json b/docs/Advanced_development/zh/config.json index ce6a268..5c944f2 100644 --- a/docs/Advanced_development/zh/config.json +++ b/docs/Advanced_development/zh/config.json @@ -1,24 +1,4 @@ { "import": "config_zh", - "navbar": { - "items": [ - { - "id": "language", - "label": "Language: ", - "position": "right", - "items": [ - { - "id": "zh", - "url": "/doc/Advanced_development/zh/", - "label": "中文" - }, - { - "id": "en", - "url": "/doc/Advanced_development/en/", - "label": "English" - } - ] - } - ] - } + "name": "进阶开发" } \ No newline at end of file diff --git a/docs/FAQ/en/config.json b/docs/FAQ/en/config.json index 5bf747e..4fee700 100644 --- a/docs/FAQ/en/config.json +++ b/docs/FAQ/en/config.json @@ -1,24 +1,4 @@ { "import": "config_en", - "navbar": { - "items": [ - { - "id": "language", - "label": "Language: ", - "position": "right", - "items": [ - { - "id": "zh", - "url": "/doc/FQA/zh/", - "label": "中文" - }, - { - "id": "en", - "url": "/doc/FQA/en/", - "label": "English" - } - ] - } - ] - } + "name": "FAQ" } \ No newline at end of file diff --git a/docs/FAQ/zh/config.json b/docs/FAQ/zh/config.json index e477459..75b41fa 100644 --- a/docs/FAQ/zh/config.json +++ b/docs/FAQ/zh/config.json @@ -1,24 +1,4 @@ { "import": "config_zh", - "navbar": { - "items": [ - { - "id": "language", - "label": "Language: ", - "position": "right", - "items": [ - { - "id": "zh", - "url": "/doc/FQA/zh/", - "label": "中文" - }, - { - "id": "en", - "url": "/doc/FQA/en/", - "label": "English" - } - ] - } - ] - } + "name": "FAQ 常见问题" } \ No newline at end of file diff --git a/docs/Product_case/en/config.json b/docs/Product_case/en/config.json index c10df20..d07c165 100644 --- a/docs/Product_case/en/config.json +++ b/docs/Product_case/en/config.json @@ -1,24 +1,4 @@ { "import": "config_en", - "navbar": { - "items": [ - { - "id": "language", - "label": "Language: ", - "position": "right", - "items": [ - { - "id": "zh", - "url": "/doc/Product_case/zh/", - "label": "中文" - }, - { - "id": "en", - "url": "/doc/Product_case/en/", - "label": "English" - } - ] - } - ] - } + "name": "Product case" } \ No newline at end of file diff --git a/docs/Product_case/zh/config.json b/docs/Product_case/zh/config.json index c0777ab..fa7b6c2 100644 --- a/docs/Product_case/zh/config.json +++ b/docs/Product_case/zh/config.json @@ -1,24 +1,4 @@ { "import": "config_zh", - "navbar": { - "items": [ - { - "id": "language", - "label": "Language: ", - "position": "right", - "items": [ - { - "id": "zh", - "url": "/doc/Product_case/zh/", - "label": "中文" - }, - { - "id": "en", - "url": "/doc/Product_case/en/", - "label": "English" - } - ] - } - ] - } + "name": "产品案例" } \ No newline at end of file diff --git a/docs/Quecpython_intro/en/config.json b/docs/Quecpython_intro/en/config.json index c078588..4f64589 100644 --- a/docs/Quecpython_intro/en/config.json +++ b/docs/Quecpython_intro/en/config.json @@ -1,24 +1,4 @@ { "import": "config_en", - "navbar": { - "items": [ - { - "id": "language", - "label": "Language: ", - "position": "right", - "items": [ - { - "id": "zh", - "url": "/doc/Quecpython_intro/zh/", - "label": "中文" - }, - { - "id": "en", - "url": "/doc/Quecpython_intro/en/", - "label": "English" - } - ] - } - ] - } + "name": "Quecpython introduction" } \ No newline at end of file diff --git a/docs/Quecpython_intro/zh/config.json b/docs/Quecpython_intro/zh/config.json index 02bdc10..db6bbb0 100644 --- a/docs/Quecpython_intro/zh/config.json +++ b/docs/Quecpython_intro/zh/config.json @@ -1,24 +1,4 @@ { "import": "config_zh", - "navbar": { - "items": [ - { - "id": "language", - "label": "Language: ", - "position": "right", - "items": [ - { - "id": "zh", - "url": "/doc/Quecpython_intro/zh/", - "label": "中文" - }, - { - "id": "en", - "url": "/doc/Quecpython_intro/en/", - "label": "English" - } - ] - } - ] - } + "name": "产品介绍" } \ No newline at end of file diff --git a/docs/Quick_start/en/config.json b/docs/Quick_start/en/config.json index 57c3904..998a22b 100644 --- a/docs/Quick_start/en/config.json +++ b/docs/Quick_start/en/config.json @@ -1,24 +1,4 @@ { "import": "config_en", - "navbar": { - "items": [ - { - "id": "language", - "label": "Language: ", - "position": "right", - "items": [ - { - "id": "zh", - "url": "/doc/Quick_start/zh/", - "label": "中文" - }, - { - "id": "en", - "url": "/doc/Quick_start/en/", - "label": "English" - } - ] - } - ] - } + "name": "Quick start" } \ No newline at end of file diff --git a/docs/Quick_start/zh/config.json b/docs/Quick_start/zh/config.json index 667b3e6..84fb0f4 100755 --- a/docs/Quick_start/zh/config.json +++ b/docs/Quick_start/zh/config.json @@ -1,24 +1,4 @@ { "import": "config_zh", - "navbar": { - "items": [ - { - "id": "language", - "label": "Language: ", - "position": "right", - "items": [ - { - "id": "zh", - "url": "/doc/Quick_start/zh/", - "label": "中文" - }, - { - "id": "en", - "url": "/doc/Quick_start/en/", - "label": "English" - } - ] - } - ] - } + "name": "快速开始" } \ No newline at end of file diff --git a/docs/sbs/en/config.json b/docs/sbs/en/config.json index 91f3781..a69eca2 100644 --- a/docs/sbs/en/config.json +++ b/docs/sbs/en/config.json @@ -1,24 +1,4 @@ { "import": "config_zh", - "navbar": { - "items": [ - { - "id": "language", - "label": "Language: ", - "position": "right", - "items": [ - { - "id": "zh", - "url": "doc/sbs/zh/", - "label": "中文" - }, - { - "id": "en", - "url": "doc/sbs/en/", - "label": "English" - } - ] - } - ] - } + "name": "Tutorial" } \ No newline at end of file diff --git a/docs/sbs/zh/config.json b/docs/sbs/zh/config.json index 91f3781..024b2e9 100644 --- a/docs/sbs/zh/config.json +++ b/docs/sbs/zh/config.json @@ -1,24 +1,4 @@ { "import": "config_zh", - "navbar": { - "items": [ - { - "id": "language", - "label": "Language: ", - "position": "right", - "items": [ - { - "id": "zh", - "url": "doc/sbs/zh/", - "label": "中文" - }, - { - "id": "en", - "url": "doc/sbs/en/", - "label": "English" - } - ] - } - ] - } + "name": "基础教程" } \ No newline at end of file diff --git a/pages/index/en/404.md b/pages/index/en/404.md index 294b93a..4ba9fd0 100644 --- a/pages/index/en/404.md +++ b/pages/index/en/404.md @@ -1,3 +1,4 @@ +--- +layout: 404 +--- - -

Page NOT FOUND~

\ No newline at end of file diff --git a/pages/index/en/config.json b/pages/index/en/config.json index c88e132..fc3d168 100644 --- a/pages/index/en/config.json +++ b/pages/index/en/config.json @@ -1,4 +1,5 @@ { "import": "config_en", - "class": "md_page" + "class": "md_page", + "name": "English pages" } \ No newline at end of file diff --git a/pages/index/zh/404.md b/pages/index/zh/404.md index 1df97d4..c4e870f 100644 --- a/pages/index/zh/404.md +++ b/pages/index/zh/404.md @@ -1,4 +1,3 @@ - - - -

没有找到页面哦~

+--- +layout: 404 +--- diff --git a/pages/index/zh/config.json b/pages/index/zh/config.json index 386982b..0dc7e9d 100644 --- a/pages/index/zh/config.json +++ b/pages/index/zh/config.json @@ -1,4 +1,5 @@ { "import": "config_zh", - "class": "md_page" + "class": "md_page", + "name": "中文页面" } \ No newline at end of file diff --git a/site_config.json b/site_config.json index 40e5e17..87dc122 100644 --- a/site_config.json +++ b/site_config.json @@ -1,29 +1,21 @@ { "site_name": "QuecPython", "site_slogon": "让开发更迅速", - "site_root_url": "/doc", + "site_root_url": "/doc/", "site_domain": "gitee.com/quecpython/wiki", "site_protocol": "https", "config_template_dir": "config", "route": { "docs": { - "/doc/Quecpython_intro/zh": "docs/Quecpython_intro/zh", - "/doc/Quick_start/zh": "docs/Quick_start/zh", - "/doc/sbs/zh": "docs/sbs/zh", - "/doc/Advanced_development/zh": "docs/Advanced_development/zh", - "/doc/Product_case/zh": "docs/Product_case/zh", - "/doc/FAQ/zh": "docs/FAQ/zh", - "/doc/Quecpython_intro/en": "docs/Quecpython_intro/en", - "/doc/Quick_start/en": "docs/Quick_start/en", - "/doc/sbs/en": "docs/sbs/en", - "/doc/Advanced_development/en": "docs/Advanced_development/en", - "/doc/Product_case/en": "docs/Product_case/en", - "/doc/FAQ/en": "docs/FAQ/en" - + "/doc/Quecpython_intro/zh/": "docs/Quecpython_intro/zh", + "/doc/Quick_start/zh/": "docs/Quick_start/zh", + "/doc/sbs/zh/": "docs/sbs/zh", + "/doc/Advanced_development/zh/": "docs/Advanced_development/zh", + "/doc/Product_case/zh/": "docs/Product_case/zh", + "/doc/FAQ/zh/": "docs/FAQ/zh" }, "pages": { - "/": "pages/index/zh", - "/en/": "pages/index/en" + "/": "pages/index/zh" }, "assets": { "/static/": "static", @@ -31,6 +23,47 @@ }, "/blog/": "blog" }, + "translate": { + "docs": { + "/doc/Quecpython_intro/zh/": [ { + "url": "/doc/Quecpython_intro/en/", + "src": "docs/Quecpython_intro/en" + } + ], + "/doc/Quick_start/zh/": [ { + "url": "/doc/Quick_start/en/", + "src": "docs/Quick_start/en" + } + ], + "/doc/sbs/zh/": [ { + "url": "/doc/sbs/en/", + "src": "docs/sbs/en" + } + ], + "/doc/Advanced_development/zh/": [ { + "url": "/doc/Advanced_development/en/", + "src": "docs/Advanced_development/en" + } + ], + "/doc/Product_case/zh/": [ { + "url": "/doc/Product_case/en/", + "src": "docs/Product_case/en" + } + ], + "/doc/FAQ/zh/": [ { + "url": "/doc/FAQ/en", + "src": "docs/FAQ/en" + } + ] + }, + "pages": { + "/": [ { + "url": "/en/", + "src": "pages/index/en" + } + ] + } + }, "executable": { "python": "python3", "pip": "pip3" -- Gitee