You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ji...@apache.org on 2019/05/05 10:23:21 UTC
[flink] branch master updated: [FLINK-11732] [docs] Add a language
switch to the sidebar for Flink documents
This is an automated email from the ASF dual-hosted git repository.
jincheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/master by this push:
new c538b01 [FLINK-11732] [docs] Add a language switch to the sidebar for Flink documents
c538b01 is described below
commit c538b01caa1949c3d7ddc02edf4eed4abbb4a5dd
Author: Jark Wu <im...@gmail.com>
AuthorDate: Mon Apr 22 20:11:17 2019 +0800
[FLINK-11732] [docs] Add a language switch to the sidebar for Flink documents
This closes #8238
add contribute translation link to English pages.
---
docs/_includes/sidenav.html | 20 +++++++++++++++++++-
docs/_layouts/plain.html | 12 ++++++++++++
docs/page/css/flink.css | 16 ++++++++++++++++
3 files changed, 47 insertions(+), 1 deletion(-)
diff --git a/docs/_includes/sidenav.html b/docs/_includes/sidenav.html
index e21a598..247a0e3 100644
--- a/docs/_includes/sidenav.html
+++ b/docs/_includes/sidenav.html
@@ -148,7 +148,12 @@ level is determined by 'nav-pos'.
<div class="sidenav-versions">
<div class="dropdown">
- <button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown">Pick Docs Version
+ <button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown">
+ {% if page.is_default_language %}
+ Pick Docs Version
+ {% else %}
+ 选择文档版本
+ {% endif %}
<span class="caret"></span></button>
<ul class="dropdown-menu">
{% for d in site.previous_docs %}
@@ -157,3 +162,16 @@ level is determined by 'nav-pos'.
</ul>
</div>
</div>
+
+<div class="sidenav-languages">
+ {% if page.is_default_language %}
+ <!-- link to the Chinese home page when current is blog page -->
+ <a href="{{ site.baseurl }}/zh{{ page.url }}">
+ <button type="submit" class="btn btn-default">中文版</button>
+ </a>
+ {% else %}
+ <a href="{{ site.baseurl }}{{ page.url | remove_first: 'zh/' }}">
+ <button type="submit" class="btn btn-default">English</button>
+ </a>
+ {% endif %}
+</div>
diff --git a/docs/_layouts/plain.html b/docs/_layouts/plain.html
index 682ecbf..10c5993 100644
--- a/docs/_layouts/plain.html
+++ b/docs/_layouts/plain.html
@@ -64,3 +64,15 @@ under the License.
{% endif %}
{{ content }}
+
+
+<div class="footer">
+ <a href="https://cwiki.apache.org/confluence/display/FLINK/Flink+Translation+Specifications" target="_blank">
+ {% if page.language == "zh" %}
+ 想参与贡献翻译?
+ {% else if page.language == "en" %}
+ Want to contribute translation?
+ {% endif %}
+ </a>
+</div>
+
diff --git a/docs/page/css/flink.css b/docs/page/css/flink.css
index a17027d..cb41239 100644
--- a/docs/page/css/flink.css
+++ b/docs/page/css/flink.css
@@ -30,6 +30,14 @@ body {
background: #f8f8f8;
}
+.footer {
+ color: #7f8c8d;
+ margin-top: 4em;
+ padding-top: 1em;
+ border-top: 1px solid #e5e5e5;
+ font-size: .9em;
+}
+
@media (min-width: 992px) and (max-width: 1200px) {
#contentcol { float: left; width: 70%; }
#sidenavcol { float: left; width: 30%; }
@@ -298,3 +306,11 @@ ul#sidenav {
.sidenav-versions button {
width: 100%;
}
+
+.sidenav-languages {
+ padding: 10px;
+}
+
+.sidenav-languages button {
+ width: 100%;
+}