octopress-multilingual 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/octopress-multilingual.rb +8 -16
- data/lib/octopress-multilingual/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae2a7d77082269627ef469a575b895949ae49989
|
4
|
+
data.tar.gz: 472a8cfecf409781c79272d665abc7df984c6236
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43a2416772b2c9af04bdc6913e3b8cd36232a39eb2c60fd0ce00ce01cf6671faf6a3c01caeac2410575e87babe11768020614bc31f55d239e4fb1858198383c5
|
7
|
+
data.tar.gz: 4cbbda31c6c4e7f00d1205fcb71f5bae2979901b59c4a7cda16e1e667de77d619eea38c4369218361255ce66c6e0f10173f9f1dbfc0fbd752f277097f21ab118
|
data/CHANGELOG.md
CHANGED
@@ -15,12 +15,10 @@ module Octopress
|
|
15
15
|
attr_accessor :site
|
16
16
|
|
17
17
|
def main_language
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
<< "Your Jekyll site configuration must have a main language. For example:\n\n" \
|
23
|
-
<< " lang: en\n\n"
|
18
|
+
@lang ||= begin
|
19
|
+
if lang = site.config['lang']
|
20
|
+
lang.downcase
|
21
|
+
end
|
24
22
|
end
|
25
23
|
end
|
26
24
|
|
@@ -29,11 +27,7 @@ module Octopress
|
|
29
27
|
end
|
30
28
|
|
31
29
|
def language_name(name=nil)
|
32
|
-
|
33
|
-
language
|
34
|
-
else
|
35
|
-
name
|
36
|
-
end
|
30
|
+
language_names[name] || name
|
37
31
|
end
|
38
32
|
|
39
33
|
def language_names
|
@@ -133,17 +127,15 @@ module Octopress
|
|
133
127
|
|
134
128
|
def site_payload
|
135
129
|
# Skip when when showing documentation site
|
136
|
-
if
|
137
|
-
{}
|
138
|
-
else
|
139
|
-
return unless main_language
|
140
|
-
|
130
|
+
if main_language
|
141
131
|
@payload ||= {
|
142
132
|
'posts_by_language' => posts_by_language,
|
143
133
|
'linkposts_by_language' => linkposts_by_language,
|
144
134
|
'articles_by_language' => articles_by_language,
|
145
135
|
'languages' => languages
|
146
136
|
}
|
137
|
+
else
|
138
|
+
{}
|
147
139
|
end
|
148
140
|
end
|
149
141
|
end
|