jekyll-rtd-theme 0.1.9 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ce83e5fded9b546214f895e23e6201513528b3983ff0d0c8327cbd00aac257a4
4
- data.tar.gz: 7b0e1c1952a373332e021674262c0c5345db66db013f75c9a5be041d74635ce2
3
+ metadata.gz: b61e6939570e8e17427fc25c946f3c71898ae8b8577738fcb0fe18d3a9705947
4
+ data.tar.gz: 8a6881d5c9972017f2d4c46f762abde775e7faa91069fd3d1af575b79fa25ca6
5
5
  SHA512:
6
- metadata.gz: 631141d782ff15262ee5c58cc04c80547c21f879447ce832f5e3073dcc8ccd596566ec733e053001fc1f4869137ddc014be0017368aa02b9911f01065fdc8dbd
7
- data.tar.gz: fe61300c17e3f8c8daf3b73a830a3e4698a25b2dcbd05711d49f9e531a18f405d1f0334851bc2bc659f97e151743952fdbba556bb40ca4cca37ae21d37f58270
6
+ metadata.gz: 9df9150705c695c6df77afde19e06309a3299a72cac77ea42c0c983cb5d22fba636f9359e9420df944c11d2ef5a313e9a7880759058767cc163543271f373568
7
+ data.tar.gz: f6f74fc89f2d28e53a1e1d4abd250bf3f76717cebdcc2e576a53e3b5897719b9e0c3f0c3da74715592f0bbced77a341e714a67d4f2322718792451ba48c8b3c8
@@ -0,0 +1,13 @@
1
+ <dl>
2
+ <dt>{{ __translations }}</dt>
3
+ {%- for item in site_langs -%}
4
+ <dd>
5
+ {%- if item == site.lang -%}
6
+ {%- assign url = "" -%}
7
+ {%- else -%}
8
+ {%- assign url = item | append: "/" -%}
9
+ {%- endif -%}
10
+ <a href="{{ site.baseurl }}/{{ url }}"><i class="fa fa-language"></i> {{ item }}</a>
11
+ </dd>
12
+ {%- endfor -%}
13
+ </dl>
@@ -1,7 +1,7 @@
1
1
  <div class="album">
2
2
  {%- for item in include.data -%}
3
- <a class="item" href="{{ item.href | default: '#' }}">
4
- <img src="{{ item.image }}">{{ item.name }}
3
+ <a class="item" href="{{ item.link | default: '#' }}">
4
+ <img src="{{ item.image }}">{{ item.title }}
5
5
  </a>
6
6
  {%- endfor -%}
7
7
  </div>
@@ -22,7 +22,13 @@
22
22
  {{ site.baseurl }}/{% for block in blocks limit: forloop.index %}{{ block | append: "/" }}{% endfor %}
23
23
  {%- endcapture %}
24
24
  <li>
25
- <a href="{{ href }}">{{ block | split: "." | last | capitalize }}</a><i class="fa fa-angle-double-right"></i>
25
+ <a href="{{ href }}">
26
+ {%- if block == lang -%}
27
+ {{ block }}
28
+ {%- else -%}
29
+ {{ block | capitalize }}
30
+ {%- endif -%}
31
+ </a><i class="fa fa-angle-double-right"></i>
26
32
  </li>
27
33
  {%- endif -%}
28
34
  {%- endfor -%}
@@ -1,6 +1,9 @@
1
1
  {%- include reset/workdir.liquid %}
2
2
 
3
3
  {%- assign dir = site_pages | where: "url", workdir | first -%}
4
+ {%- if site_lang != lang -%}
5
+ {%- assign workdir_level = workdir_level | minus: 1 -%}
6
+ {%- endif -%}
4
7
  {%- if workdir_level == 2 %}
5
8
  <p class="caption"><span class="caption-text">{{ dir.title | default: dir.url }}</span></p>
6
9
  {%- else %}
@@ -13,6 +16,10 @@
13
16
  {%- capture current -%}
14
17
  {%- if page.url == item.url %}current{% endif -%}
15
18
  {%- endcapture %}
19
+ {%- if site_lang != lang -%}
20
+ {%- assign level = level | minus: 1 -%}
21
+ {%- endif -%}
22
+
16
23
  <li class="toctree-l{{ level }} {{ current }}">
17
24
  <a class="reference internal {{ current }}" href="{{ site.baseurl | append: item.url }}">
18
25
  {%- if item.sort and site.show_sorted != false -%}
@@ -24,6 +31,9 @@
24
31
  {%- endfor -%}
25
32
  {%- for workdir in workdir_dirs -%}
26
33
  {%- assign level = workdir | append: "temp/" | split: "/" | size | minus: 3 %}
34
+ {%- if site_lang != lang -%}
35
+ {%- assign level = level | minus: 1 -%}
36
+ {%- endif -%}
27
37
  <li class="toctree-l{{ level }}">{% include extend/toctree.liquid %}</li>
28
38
  {%- endfor -%}
29
39
  </ul>
@@ -3,6 +3,7 @@
3
3
  {%- assign __issues = "Issues" -%}
4
4
  {%- assign __download = "Download" -%}
5
5
  {%- assign __gems = "Gems" -%}
6
+ {%- assign __translations = "Translations" -%}
6
7
  {%- assign __statistics = "Statistics" -%}
7
8
  {%- assign __total_visits = "Total visits:" -%}
8
9
 
@@ -3,6 +3,7 @@
3
3
  {%- assign __issues = "反馈" -%}
4
4
  {%- assign __download = "下载" -%}
5
5
  {%- assign __gems = "主题插件" -%}
6
+ {%- assign __translations = "文档翻译" -%}
6
7
  {%- assign __statistics = "访问统计" -%}
7
8
  {%- assign __total_visits = "累计浏览次数:" -%}
8
9
 
@@ -1,6 +1,6 @@
1
1
  {%- assign description = content | strip_html | split: " " | join: " " | escape | truncate: 150 -%}
2
- {%- assign version = "0.1.9" -%}
3
- {%- assign addons = "github, gems, analytics" | split: ", " -%}
2
+ {%- assign version = "1.0.0" -%}
3
+ {%- assign addons = "github, i18n, gems, analytics" | split: ", " -%}
4
4
 
5
5
  {%- include reset/site_pages.liquid %}
6
6
  {%- include reset/i18n.liquid -%}
@@ -1,3 +1,23 @@
1
- {%- assign lang = site.lang | default: "en-US" -%}
1
+ {%- assign site_lang = site.lang | default: "en-US" -%}
2
2
 
3
- {%- include i18n/{{ lang | split: "-" | first }}.liquid -%}
3
+ {%- capture langs -%}
4
+ {{ site_lang }}|
5
+ {%- for item in site_dirs -%}
6
+ {%- assign chapter = item.dir | remove_first: "/" | split: "/" | first -%}
7
+ {%- if chapter contains "-" -%}
8
+ {{ chapter }}|
9
+ {%- endif -%}
10
+ {%- endfor -%}
11
+ {%- endcapture -%}
12
+ {%- assign site_langs = langs | split: "|" | uniq -%}
13
+
14
+ {%- assign lang = site_lang -%}
15
+
16
+ {%- if page.dir != "/" -%}
17
+ {%- assign chapter = page.dir | remove_first: "/" | split: "/" | first -%}
18
+ {%- if chapter contains "-" -%}
19
+ {%- assign lang = chapter -%}
20
+ {%- endif -%}
21
+ {%- endif -%}
22
+
23
+ {%- include i18n/{{ lang }}.liquid -%}
@@ -1,4 +1,13 @@
1
+ {% comment %} Start from the language chapter(eg: en-US) or root(/) {% endcomment %}
1
2
  {%- assign workdir = include.workdir | default: "/" -%}
3
+
4
+ {%- if page.dir != "/" -%}
5
+ {%- assign chapter = page.dir | remove_first: "/" | split: "/" | first -%}
6
+ {%- if chapter contains "-" -%}
7
+ {%- capture workdir %}/{{ chapter }}/{% endcapture -%}
8
+ {%- endif -%}
9
+ {%- endif -%}
10
+
2
11
  {%- assign workdir_level = workdir | append: "temp/" | split: "/" | size | minus: 1 -%}
3
12
  {%- assign workdir_files = site_files | where_exp: "item", "item.dir == workdir" -%}
4
13
 
@@ -8,8 +17,14 @@
8
17
  {%- if workdir_level == current_m1 -%}
9
18
  {%- assign temp = workdir | append: "@@" -%}
10
19
  {%- assign dir = item.dir | replace: workdir, temp | split: "@@" | first -%}
20
+ {% comment %} In the current subdirectory {% endcomment %}
11
21
  {%- if workdir == dir -%}
12
- {{ item.dir }}|
22
+ {% comment %} Root directory does not display other languages {% endcomment %}
23
+ {%- if workdir == "/" -%}
24
+ {%- unless item.dir contains "-" %}{{ item.dir }}|{% endunless -%}
25
+ {%- else -%}
26
+ {{ item.dir }}|
27
+ {%- endif -%}
13
28
  {%- endif -%}
14
29
  {%- endif -%}
15
30
  {%- endfor -%}
@@ -61,11 +61,11 @@ layout: plugins/compress
61
61
  <div class="wy-side-scroll">
62
62
  <div class="wy-side-nav-search">
63
63
  {% if site.logo %}
64
- <a href="{{ site.baseurl }}/">
64
+ <a href="{{ site.baseurl }}/{% if site_lang != lang %}{{ lang }}/{% endif %}">
65
65
  <img src="{{ site.baseurl }}/{{ site.logo }}" class="logo" alt="{{ site.title }}">
66
66
  </a>
67
67
  {% else %}
68
- <a href="{{ site.baseurl }}/" class="icon icon-home"> {{ site.title }}</a>
68
+ <a href="{{ site.baseurl }}/{% if site_lang != lang %}{{ lang }}/{% endif %}" class="icon icon-home"> {{ site.title }}</a>
69
69
  {% endif %}
70
70
  {% include searchbox.liquid %}
71
71
  </div>
@@ -83,7 +83,7 @@ layout: plugins/compress
83
83
  <!-- MOBILE NAV -->
84
84
  <nav class="wy-nav-top" aria-label="top navigation">
85
85
  <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
86
- <a href="{{ site.baseurl }}/">{{ site.title }}</a>
86
+ <a href="{{ site.baseurl }}/{% if site_lang != lang %}{{ lang }}/{% endif %}">{{ site.title }}</a>
87
87
  </nav>
88
88
  <div class="wy-nav-content">
89
89
  <div class="rst-content">
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  permalink: /404.html
3
+ layout: default
3
4
  ---
4
5
 
5
6
  {%- include reset/i18n.liquid -%}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-rtd-theme
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - saowang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-31 00:00:00.000000000 Z
11
+ date: 2020-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: github-pages
@@ -43,6 +43,7 @@ files:
43
43
  - _includes/addons/source/analytics.liquid
44
44
  - _includes/addons/source/gems.liquid
45
45
  - _includes/addons/source/github.liquid
46
+ - _includes/addons/source/i18n.liquid
46
47
  - _includes/album.liquid
47
48
  - _includes/assets/custom.js
48
49
  - _includes/assets/custom.scss
@@ -52,8 +53,8 @@ files:
52
53
  - _includes/extend/tabs.liquid
53
54
  - _includes/extend/toctree.liquid
54
55
  - _includes/footer.liquid
55
- - _includes/i18n/en.liquid
56
- - _includes/i18n/zh.liquid
56
+ - _includes/i18n/en-US.liquid
57
+ - _includes/i18n/zh-CN.liquid
57
58
  - _includes/list.liquid
58
59
  - _includes/reset/defaults.liquid
59
60
  - _includes/reset/i18n.liquid