jekyll-multiple-languages 1.0.3 → 1.0.4
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 +8 -8
- data/lib/jekyll-multiple-languages.rb +33 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NTk3MjJlMjNlMTQ1MDMzYTMyZTQ4ZjVmODA1NjQ0NzI5MWM3YzQyMg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZGIwZDhiNTUyN2M2NzVhNWI3NjAwMWY1NWMzNjI4NjIxOTVhMGVmZg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
M2RlMzUyMzMyM2JkMjY1MDhmMThmNjRhNTdjMzYzZmE1ZmE4NDMxYWU5Yzdh
|
10
|
+
ODBlMTU0Mjc4NTIzZDUzMDcwNjhjZmNkNWRkNmM3NzlmYWM2NmM3OTViMGYx
|
11
|
+
MjQwZWFmYWQ3YTgzMmZjYWNiMmE5YjJmZDYxMGRmZWI3MmZmNzM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZmQ0ODMxNWJhZmM5ZjhlMDE3MGYxMjI2ZjdlOTI3NDE1N2I3OTIzNTYwYmVk
|
14
|
+
NjU3Mjk0ZDcxZjI3OGNmMWI5ODc4YjdlMzZhMjE0YWFlNjgzZTAwNjRhZDll
|
15
|
+
NDQ4Yjg1ZTMyMGM0YWRjMmFkZjA2OGU0YzcxMGU4Y2MxNWIxOGY=
|
@@ -4,6 +4,7 @@ module Jekyll
|
|
4
4
|
module MultiLang
|
5
5
|
attr_accessor :language, :name_no_language, :is_default_language, :url_no_language, :dir_source
|
6
6
|
|
7
|
+
# rewirte initialize
|
7
8
|
def process_initialize(site, base, dir, name)
|
8
9
|
name_no_language = name.dup
|
9
10
|
|
@@ -33,6 +34,7 @@ module Jekyll
|
|
33
34
|
@url_no_language
|
34
35
|
end
|
35
36
|
|
37
|
+
# rewirte url
|
36
38
|
def process_url
|
37
39
|
if !@url
|
38
40
|
url = self.url_org
|
@@ -46,6 +48,7 @@ module Jekyll
|
|
46
48
|
@url
|
47
49
|
end
|
48
50
|
|
51
|
+
# rewirte to_liquid
|
49
52
|
def process_to_liquid(attrs = nil)
|
50
53
|
data_for_liquid = self.to_liquid_org(attrs)
|
51
54
|
attrs_for_lang = self.language_attributes_for_liquid || []
|
@@ -158,17 +161,29 @@ module Jekyll
|
|
158
161
|
|
159
162
|
alias :url_org :url
|
160
163
|
def url
|
161
|
-
|
164
|
+
if @language
|
165
|
+
process_url
|
166
|
+
else
|
167
|
+
url_org
|
168
|
+
end
|
162
169
|
end
|
163
170
|
|
164
171
|
alias :process_org :process
|
165
172
|
def process(name)
|
166
|
-
|
173
|
+
if @language
|
174
|
+
process_org(@name_no_language)
|
175
|
+
else
|
176
|
+
process_org(name)
|
177
|
+
end
|
167
178
|
end
|
168
179
|
|
169
180
|
alias :to_liquid_org :to_liquid
|
170
181
|
def to_liquid(attrs = nil)
|
171
|
-
|
182
|
+
if @language
|
183
|
+
process_to_liquid(attrs)
|
184
|
+
else
|
185
|
+
to_liquid_org(attrs)
|
186
|
+
end
|
172
187
|
end
|
173
188
|
|
174
189
|
def language_attributes_for_liquid
|
@@ -193,12 +208,20 @@ module Jekyll
|
|
193
208
|
|
194
209
|
alias :url_org :url
|
195
210
|
def url
|
196
|
-
|
211
|
+
if @language
|
212
|
+
process_url
|
213
|
+
else
|
214
|
+
url_org
|
215
|
+
end
|
197
216
|
end
|
198
217
|
|
199
218
|
alias :process_org :process
|
200
219
|
def process(name)
|
201
|
-
|
220
|
+
if @language
|
221
|
+
process_org(@name_no_language)
|
222
|
+
else
|
223
|
+
process_org(name)
|
224
|
+
end
|
202
225
|
end
|
203
226
|
|
204
227
|
def inspect
|
@@ -218,7 +241,11 @@ module Jekyll
|
|
218
241
|
|
219
242
|
alias :to_liquid_org :to_liquid
|
220
243
|
def to_liquid(attrs = nil)
|
221
|
-
|
244
|
+
if @language
|
245
|
+
process_to_liquid(attrs)
|
246
|
+
else
|
247
|
+
to_liquid_org(attrs)
|
248
|
+
end
|
222
249
|
end
|
223
250
|
|
224
251
|
end
|