diff --git a/_config.yml b/_config.yml index b05e420e..07020701 100644 --- a/_config.yml +++ b/_config.yml @@ -25,11 +25,19 @@ defaults: is_post: true - scope: - path: _posts/es + path: _posts/it type: posts values: layout: default - lang: es + lang: it + is_post: true + - + scope: + path: _posts/zh_CN + type: posts + values: + layout: default + lang: zh_CN is_post: true # Enter your Disqus shortname (not your username) to enable commenting on posts @@ -80,3 +88,68 @@ exclude: - LICENSE - README.md - CNAME + +# languages var +languages: + - + name: en + link: / + - + name: it + link: /it + - + name: zh_CN + link: /zh_CN + +transl: + en: + menu: + home: + txt: Home + link: / + about: + txt: About + link: /about + subscribe: + txt: Subscribe + submit_your_tip: + txt: Submit your tip + link: https://github.com/loverajoel/jstips/blob/master/CONTRIBUTING.md + footer_subscribe_message: Subscribe to more awesome daily tips! + footer_placeholder_subscribe: your@email.com + arrow_prev: Previous Tip + arrow_next: Next Tip + it: + menu: + home: + txt: Home + link: /it + about: + txt: About + link: /it/about + subscribe: + txt: Subscribe + submit_your_tip: + txt: Submit your tip + link: https://github.com/loverajoel/jstips/blob/master/CONTRIBUTING.md + footer_subscribe_message: Subscribe to more awesome daily tips! + footer_placeholder_subscribe: your@email.com + arrow_prev: Previous Tip + arrow_next: Next Tip + zh_CN: + menu: + home: + txt: 主页 + link: /zh_CN + about: + txt: 关于 + link: /zh_CN/about + subscribe: + txt: 订阅 + submit_your_tip: + txt: 提交小知识 + link: https://github.com/loverajoel/jstips/blob/master/CONTRIBUTING.md + footer_subscribe_message: 订阅,每天获取一条小知识! + footer_placeholder_subscribe: your@email.com + arrow_prev: 上一条 + arrow_next: 下一条 diff --git a/_layouts/default.html b/_layouts/default.html index 189d5a53..d9c5bfbb 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -62,18 +62,18 @@
- {% if page.is_post %} - {% if page.previous.url %} + {% if page.is_post%} + {% if page.previous.url and page.previous.lang == page.lang %} -

Previous Tip

+

{{site.transl[page.lang].arrow_prev}}

{% endif %} - {% if page.next.url %} + {% if page.next.url and page.next.lang == page.lang %} -

Next Tip

+

{{site.transl[page.lang].arrow_next}}

{% endif %} {% endif %} @@ -81,7 +81,7 @@ {% if page.is_post %}
@@ -94,10 +94,20 @@ {% else %} @@ -130,9 +140,9 @@
- + @@ -144,9 +154,9 @@