academic 0.4.94 → 0.4.95

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1606c56ded3bea18e89e88d631df5003e63f1ade
4
- data.tar.gz: 0f6e66e1b8e9144f9d1e009fdf5716628fad438b
3
+ metadata.gz: 79a7ac076a6b5e8234efe6f3854f44c0ed2c84a3
4
+ data.tar.gz: 27788a38a7c9dee63e4652dbdd8410c569f03df0
5
5
  SHA512:
6
- metadata.gz: 1f97262d50af0e4434d770d114dfa95d421abaa411e623a2a7c338a5ec0ec79bb1895e41aa1a2421da5dde1b442c4020afcb9e67efc0a91abdf176f57c6fbe7a
7
- data.tar.gz: 48fa5b6f027acc761ee17cd628b8460d2246fe4cac660ce50fcc51f67bb6089e188b8b3747a3f7d7642725c272fe39ebd40dee8b3378c7f930675034c0879f8b
6
+ metadata.gz: 3b02a7a28afe42779bdc221e4c1dacf3e86c442148d58a9ff13c9e0c92d549bf42e94e266d9df5d71782c21b6176aa29516de8a687fe3316743068ba8281c29b
7
+ data.tar.gz: 0de69486e953f937149dd5e71d63dd570585051a1da0f16f87d5b8c5dfa8b6d0340750ada3e3feec83ea6429c38de788a1163741184ed6b4c03e87572b957269
data/README.md CHANGED
@@ -8,10 +8,12 @@ Check out my [personal website](https://gaalcaras.com) or my [blog](https://soci
8
8
  ![Academic screenshot](screenshot.png)
9
9
 
10
10
  **Simplicity**: both in design and configuration, Academic aims to let the writer and its readers focus on the content.
11
+ Almost all of the theme configuration happens in the `_config.yml` file.
11
12
 
12
13
  **Typography**: the goal of Academic is to let the author write very long and detailed posts, while being kind to its readers' eyes.
13
14
 
14
15
  **Flexibility**: Academic can be used to generate different layouts while keeping the same look and feel.
16
+ All features require you to *opt in*, which means that you can either use a very lean `_config.yml` or a very detailed one if you want to use more features.
15
17
 
16
18
  ---
17
19
 
@@ -46,7 +48,7 @@ Table of contents:
46
48
  + Comfortable line length (around 66 characters, [read more](http://webtypography.net/2.1.2))
47
49
  + Attention to vertical rhythm, law of proximity and so on ([read more](http://typographyhandbook.com/))
48
50
  + If you'd like a **multilingual** website, Academic has basic **i18n** support (no plugin required):
49
- + English and French translations are included in the theme
51
+ + *Supported languages* : English, French
50
52
  + Lang selector to change languages automatically added in header and footer
51
53
  + Basic SEO support for multilingual pages
52
54
  + Add an **image thumbnail** to illustrate your posts. It's displayed both on the post list and on the post itself.
@@ -182,8 +184,14 @@ nav_ext_links:
182
184
  #### Multilingual and i18n support
183
185
 
184
186
  Academic works perfectly well as a single language website.
185
- But if you need to translate part of your pages or posts, it also supports basic i18n and multilingual features.
186
- The theme includes French and English versions as of now.
187
+ By default, Academic is in English.
188
+ You can easily switch to another supported language :
189
+
190
+ ```yaml
191
+ langs: ["fr"]
192
+ ```
193
+
194
+ If you need to translate part of your pages or posts, Academic also supports basic i18n and multilingual features.
187
195
 
188
196
  To enable multilingual mode, just add the following to your `_config.yml`:
189
197
 
@@ -198,6 +206,7 @@ defaults:
198
206
 
199
207
  The `langs` variable should be an array containing your languages.
200
208
  Important: the first item should be your "default" language (ie the language that you translate posts from or/and that has the largest content available).
209
+ The double quotes around the language *do* matter.
201
210
 
202
211
  Don't forget to define a default lang for your whole website.
203
212
 
@@ -37,7 +37,8 @@
37
37
 
38
38
  <div class="bottom">
39
39
 
40
- {% if site.langs %}
40
+ {% assign nblangs = site.langs | size %}
41
+ {% if nblangs > 1 %}
41
42
  {% include lang_selector.html %}
42
43
  {% endif %}
43
44
 
@@ -25,7 +25,8 @@
25
25
  {% endif %}
26
26
  </div>
27
27
 
28
- {% if site.langs %}
28
+ {% assign nblangs = site.langs | size %}
29
+ {% if nblangs > 1 %}
29
30
  {% include lang_selector.html %}
30
31
  {% endif %}
31
32
 
@@ -1,3 +1,4 @@
1
+ {% assign plang = page.lang | default: site.langs[0] | default: "en" %}
1
2
  {% assign object = include.object %}
2
3
 
3
4
  {% if object.last_modified_at %}
@@ -10,11 +11,11 @@
10
11
  <span class="last-update">·
11
12
 
12
13
  {% if site.repo %}
13
- <a title="{{ site.data.academic_i18n.revhistory[page.lang] }}"
14
+ <a title="{{ site.data.academic_i18n.revhistory[plang] }}"
14
15
  href="{{site.repo}}/commits/master/{{object.path}}">
15
16
  {% endif %}
16
17
 
17
- {{ site.data.academic_i18n.lastupdated[page.lang] }}
18
+ {{ site.data.academic_i18n.lastupdated[plang] }}
18
19
  {% include date.html date=object.last_modified_at %}
19
20
 
20
21
  {% if site.repo %}
@@ -1,3 +1,10 @@
1
1
  {% assign plang = page.lang | default: site.langs[0] | default: "en" %}
2
- {% assign object = site.pages | where_exp:"p","p.path contains include.path" | where:"lang",plang | first %}
2
+ {% assign nblangs = site.langs | size %}
3
+ {% assign objects = site.pages | where_exp:"p","p.path contains include.path" %}
4
+
5
+ {% if nblangs > 1 %}
6
+ {% assign object = objects | where:"lang",plang | first %}
7
+ {% else %}
8
+ {% assign object = objects | first %}
9
+ {% endif %}
3
10
  {{ object.url }}
@@ -1,4 +1,5 @@
1
1
  {% assign plang = page.lang | default: site.langs[0] | default: "en" %}
2
+ {% assign nblangs = site.langs | size %}
2
3
  <span class="nav-list-title">{{ site.data.academic_i18n.menu[plang] }}</span>
3
4
  <ul class="nav-list {{ include.class }}">
4
5
  {% for link in site.nav_ext_links %}
@@ -9,7 +10,11 @@
9
10
  {% endif %}
10
11
  {% endfor %}
11
12
 
12
- {% assign pages = site.pages | where:"lang",plang %}
13
+ {% if nblangs > 1 %}
14
+ {% assign pages = site.pages | where:"lang",plang %}
15
+ {% else %}
16
+ {% assign pages = site.pages %}
17
+ {% endif %}
13
18
 
14
19
  {% for my_page in pages %}
15
20
  {% unless my_page.invisible %}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: academic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.94
4
+ version: 0.4.95
5
5
  platform: ruby
6
6
  authors:
7
7
  - gaalcaras